comparison src/myVncProxy/MyRfbProto.java @ 66:7632606406cb

create sendCheckMillis
author e085711
date Tue, 26 Jul 2011 13:03:08 +0900
parents 5fca2bb52dc7
children f695bc56eb4f
comparison
equal deleted inserted replaced
65:5fca2bb52dc7 66:7632606406cb
440 default: 440 default:
441 } 441 }
442 } 442 }
443 443
444 void readCheckMillis() throws IOException { 444 void readCheckMillis() throws IOException {
445 byte[] b = new byte[4]; 445 byte[] b = new byte[2];
446 readFully(b); 446 readFully(b);
447 } 447 }
448 448
449 void startCheckMills() { 449 void startCheckMillis() {
450 byte[] b = new byte[4]; 450 byte[] b = new byte[2];
451 b = castIntByte(4); 451 b[0] = (byte) CheckMillis;
452 startCheckTime = System.currentTimeMillis(); 452 b[1] = (byte) 0;
453 startCheckTime = System.currentTimeMillis();
454 System.out.println("startChckTime = "+ startCheckTime);
453 multicastqueue.put(b); 455 multicastqueue.put(b);
454 } 456 }
455 457
456 void endCheckMills() { 458 void endCheckMills() {
457 long accTime = System.currentTimeMillis(); 459 long accTime = System.currentTimeMillis();
512 514
513 }; 515 };
514 new Thread(sender).start(); 516 new Thread(sender).start();
515 517
516 } 518 }
519
520 void sendCheckMillis() {
521
522 Runnable stdin = new Runnable() {
523 public void run() {
524 int c;
525 try {
526 while( (c = System.in.read()) != -1 ) {
527 switch(c) {
528 case 's':
529 break;
530 default:
531 startCheckMillis();
532 break;
533 }
534 }
535 }catch(IOException e){
536 System.out.println(e);
537 }
538 }
539 };
540
541 new Thread(stdin).start();
542 }
543
517 } 544 }
545
546