Mercurial > hg > Members > nobuyasu > tightVNCProxy
changeset 188:d69a89f6d14a
Create BroadCast.java and GetBroadCast.java
author | one |
---|---|
date | Tue, 22 Nov 2011 13:37:38 +0900 |
parents | e7cc8bcf261d |
children | 545183e14d4e |
files | src/myVncProxy/AcceptClient.java src/myVncProxy/BroadCast.java src/myVncProxy/VncProxyService.java |
diffstat | 3 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/myVncProxy/AcceptClient.java Tue Nov 15 19:55:30 2011 +0900 +++ b/src/myVncProxy/AcceptClient.java Tue Nov 22 13:37:38 2011 +0900 @@ -57,9 +57,12 @@ //connection First time if(checkAddress(line)){ outputStream(os, ls.getFirst(),"0","0", "0"); + break; }else { if(replyCreateTree(os, port, line)) { break; + } else { + break; } } }
--- a/src/myVncProxy/BroadCast.java Tue Nov 15 19:55:30 2011 +0900 +++ b/src/myVncProxy/BroadCast.java Tue Nov 22 13:37:38 2011 +0900 @@ -19,13 +19,13 @@ str = _str; } - private void createSocket() throws IOException { + void createSocket() throws IOException { mAddr = InetAddress.getByName(MCASTADDR); soc = new MulticastSocket(); soc.setTimeToLive(1); } - private void sendData() { + void sendData() { buf = str.getBytes(); //System.out.println("strlen"+str.length()); //System.out.println("str"+str); @@ -33,8 +33,11 @@ mAddr, PORT); try { soc.send(sendPacket); + Thread.sleep(1000); } catch (IOException e) { e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); } }
--- a/src/myVncProxy/VncProxyService.java Tue Nov 15 19:55:30 2011 +0900 +++ b/src/myVncProxy/VncProxyService.java Tue Nov 22 13:37:38 2011 +0900 @@ -36,6 +36,7 @@ private AcceptThread acceptThread; private TextBox getHost; private BroadCast broadCast; + private GetBroadCast getCast; Frame vncFrame; Container vncContainer; @@ -162,9 +163,8 @@ rfbThread = new Thread(this); acceptThread = new AcceptThread(rfb, 5999); accThread = new Thread(acceptThread); - broadCast = new BroadCast(rfb.acceptPort+"*"+host+"*" - +rfb.desktopName+"*"+acc.getMyAddress()+"*"); - bCast = new Thread(broadCast); + getCast = new GetBroadCast(this); + bCast = new Thread(getCast); //broadCast.udpTransmission(rfb.acceptPort+"-"+host+"-"+rfb.desktopName); //} /*