Mercurial > hg > Members > nobuyasu > tightVNCProxy
changeset 66:7632606406cb
create sendCheckMillis
author | e085711 |
---|---|
date | Tue, 26 Jul 2011 13:03:08 +0900 |
parents | 5fca2bb52dc7 |
children | f695bc56eb4f |
files | src/myVncProxy/MyRfbProto.java src/myVncProxy/ProxyVncCanvas.java src/myVncProxy/RfbProto.java src/myVncProxy/VncProxyService.java |
diffstat | 4 files changed, 41 insertions(+), 8 deletions(-) [+] |
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(); + } + } + +
--- a/src/myVncProxy/ProxyVncCanvas.java Fri Jul 22 03:21:56 2011 +0900 +++ b/src/myVncProxy/ProxyVncCanvas.java Tue Jul 26 13:03:08 2011 +0900 @@ -359,7 +359,7 @@ // // main dispatch loop // - + long count = 0; while (true) { // System.out.println("\ncount=" + count);
--- a/src/myVncProxy/RfbProto.java Fri Jul 22 03:21:56 2011 +0900 +++ b/src/myVncProxy/RfbProto.java Tue Jul 26 13:03:08 2011 +0900 @@ -561,6 +561,10 @@ /* if (viewer.options.shareDesktop) { */ + + /** + * shared flag + */ os.write(1); // os.write(0);
--- a/src/myVncProxy/VncProxyService.java Fri Jul 22 03:21:56 2011 +0900 +++ b/src/myVncProxy/VncProxyService.java Tue Jul 26 13:03:08 2011 +0900 @@ -292,8 +292,8 @@ System.out.println("Desktop size is " + rfb.framebufferWidth + " x " + rfb.framebufferHeight); -// setEncodings(); - autoSelectEncodings(); + setEncodings(); + //showConnectionStatus(null); }