Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 62:a5b831d5b542
This version can change host.
author | Taninari YU <you@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 02 Jan 2014 07:56:30 +0900 |
parents | d9cf08c6415c |
children | 84f1c39ba3bf |
files | src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Tue Dec 31 09:13:07 2013 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Thu Jan 02 07:56:30 2014 +0900 @@ -137,6 +137,7 @@ public void createConnectionAndStart() { Thread thread; opendPort = myRfb.selectPort(5999); + //acceptThread = new AcceptThread(myRfb, opendPort); acceptThread = new AcceptThread(myRfb, opendPort); thread = new Thread(acceptThread); thread.start(); @@ -238,6 +239,7 @@ private void createSocketAndSend(LinkedList<String> clientList, String host, String port) throws UnknownHostException, IOException { boolean passFlag = false; + int counter = 0; for (String client : clientList) { if (passFlag) { Socket echoSocket = new Socket(client, 10001); @@ -245,7 +247,11 @@ echoSocket.getOutputStream()); System.out.println(client); os.writeBytes("reconnection\n"); - os.writeBytes(port + "\n"); + if(counter++ < aClient.getTreeBranch()) + os.writeBytes(port + "\n"); + else + os.writeBytes(5999 + "\n"); + os.close(); } passFlag = true;