Mercurial > hg > Applications > TreeVNC
changeset 93:7b8d3411270a
remove changeScreenInterface.
author | oc |
---|---|
date | Mon, 19 May 2014 19:14:18 +0900 |
parents | ca39d762805e |
children | 75879c316796 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ChangeHost.java src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ReconnectionRequest.java src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ScreenChanges.java |
diffstat | 4 files changed, 12 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Mon May 19 18:48:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Mon May 19 19:14:18 2014 +0900 @@ -167,11 +167,9 @@ DataOutputStream os = new DataOutputStream(clientSocket.getOutputStream()); os.writeBytes(String.valueOf(delay)+"\n"); } else { - //int width = Integer.parseInt(is.readLine()); - //int height = Integer.parseInt(is.readLine()); - // String screenSize = is.readLine(); System.out.println(newHostName); if (permitChangeScreen()) { + // please remove these numbers. changeVNCServer(newHostName, 3200, 1980); } else { continue; @@ -275,4 +273,8 @@ } } } + + public LinkedList<String> clientList() { + return clients.getList(); + } }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ChangeHost.java Mon May 19 18:48:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ChangeHost.java Mon May 19 19:14:18 2014 +0900 @@ -6,15 +6,12 @@ import java.net.UnknownHostException; import jp.ac.u_ryukyu.treevnc.server.VncProxyService; -public class ChangeHost implements Runnable,ScreenChanges { +public class ChangeHost implements Runnable { private VncProxyService vps; - private ScreenChanges screenChange; - public ChangeHost(VncProxyService _vps, boolean isApplet) { vps = _vps; - screenChange = this; } @@ -23,7 +20,9 @@ @Override public void run() { try { - while(screenChange.next()); + waitingInput(); + ReconnectionRequest reconnectionRequest = new ReconnectionRequest(vps); + reconnectionRequest.sendReconnection(String.valueOf(vps.opendPort)); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { @@ -44,24 +43,8 @@ // param hostAddress,width,height vps.changeVNCServer(str,1000,1000); } -// vps.createConnectionAndStart(); -// vps.aClient.setList(prevVps.aClient.getList()); -// clientList = prevVps.aClient.getList(); -// createSocketAndSend(clientList,String.valueOf(port)); } catch (IOException e) { e.printStackTrace(); } } - - - @Override - public boolean next() { - waitingInput(); - changeState(new ReconnectionRequest(vps)); - return true; - } - - public void changeState(ScreenChanges change) { - screenChange = change; - } }
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ReconnectionRequest.java Mon May 19 18:48:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ReconnectionRequest.java Mon May 19 19:14:18 2014 +0900 @@ -7,23 +7,16 @@ import jp.ac.u_ryukyu.treevnc.server.VncProxyService; -public class ReconnectionRequest implements ScreenChanges { +public class ReconnectionRequest { private VncProxyService vps; -// private String host; public ReconnectionRequest(VncProxyService vps) { this.vps = vps; } - @Override - public boolean next() throws UnknownHostException, IOException { - createSocketAndSend(String.valueOf(vps.opendPort)); - return false; - } - - private void createSocketAndSend(String port) throws UnknownHostException, IOException { + void sendReconnection(String port) throws UnknownHostException, IOException { int i = 0; - for(String client : vps.aClient.getList()) { + for(String client : vps.clientList()) { if(i!=0) { Socket echoSocket; echoSocket = new Socket(client, 10001);
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/state/ScreenChanges.java Mon May 19 18:48:35 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -package jp.ac.u_ryukyu.treevnc.server.state; - -import java.io.IOException; -import java.net.UnknownHostException; - -public interface ScreenChanges { - - boolean next() throws UnknownHostException, IOException; - -}