Mercurial > hg > Members > nobuyasu > tightVNCProxy
diff src/myVncProxy/MyRfbProto.java @ 66:7632606406cb
create sendCheckMillis
author | e085711 |
---|---|
date | Tue, 26 Jul 2011 13:03:08 +0900 |
parents | 5fca2bb52dc7 |
children | f695bc56eb4f |
line wrap: on
line diff
--- a/src/myVncProxy/MyRfbProto.java Fri Jul 22 03:21:56 2011 +0900 +++ b/src/myVncProxy/MyRfbProto.java Tue Jul 26 13:03:08 2011 +0900 @@ -442,14 +442,16 @@ } void readCheckMillis() throws IOException { - byte[] b = new byte[4]; + byte[] b = new byte[2]; readFully(b); } - void startCheckMills() { - byte[] b = new byte[4]; - b = castIntByte(4); - startCheckTime = System.currentTimeMillis(); + void startCheckMillis() { + byte[] b = new byte[2]; + b[0] = (byte) CheckMillis; + b[1] = (byte) 0; + startCheckTime = System.currentTimeMillis(); + System.out.println("startChckTime = "+ startCheckTime); multicastqueue.put(b); } @@ -514,4 +516,31 @@ new Thread(sender).start(); } + + void sendCheckMillis() { + + Runnable stdin = new Runnable() { + public void run() { + int c; + try { + while( (c = System.in.read()) != -1 ) { + switch(c) { + case 's': + break; + default: + startCheckMillis(); + break; + } + } + }catch(IOException e){ + System.out.println(e); + } + } + }; + + new Thread(stdin).start(); + } + } + +