Mercurial > hg > Applications > TreeVNC
changeset 69:21108e863b8a
update client list.
author | one |
---|---|
date | Tue, 11 Mar 2014 15:29:52 +0900 |
parents | e6550afe663b |
children | 1370ef754bcf |
files | src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java src/main/java/jp/ac/u_ryukyu/treevnc/server/GetBroadCastProxy.java src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java src/viewer_swing/java/com/glavsoft/viewer/Viewer.java src/viewer_swing/java/com/glavsoft/viewer/ViewerImpl.java |
diffstat | 5 files changed, 17 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java Mon Mar 10 22:41:30 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java Tue Mar 11 15:29:52 2014 +0900 @@ -15,7 +15,6 @@ import com.glavsoft.rfb.protocol.ProtocolContext; import com.glavsoft.transport.Reader; import com.glavsoft.transport.Writer; -import com.glavsoft.viewer.Viewer; import com.glavsoft.viewer.ViewerImpl; public class MyRfbProto {
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/GetBroadCastProxy.java Mon Mar 10 22:41:30 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/GetBroadCastProxy.java Tue Mar 11 15:29:52 2014 +0900 @@ -20,6 +20,7 @@ private BroadCastProxy bCast; private String address; private String str = "who"; + private MulticastSocket soc; public GetBroadCastProxy(VncProxyService _vps,String desktopName,String host){ vps = _vps; @@ -32,7 +33,7 @@ byte[] resorve = new byte[BufSize]; try { InetAddress mAddr = InetAddress.getByName(McastAddr); - MulticastSocket soc = new MulticastSocket(Port); + soc = new MulticastSocket(Port); DatagramPacket recvPacket = new DatagramPacket(buf, BufSize); soc.joinGroup(mAddr); while (!stopFlag) {
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Mon Mar 10 22:41:30 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/server/VncProxyService.java Tue Mar 11 15:29:52 2014 +0900 @@ -58,6 +58,7 @@ static VncProxyService currentVps; private int fbWidth = 0; private int fbHeight = 0; + private boolean firstTime = true; private void initProxy(Parser parser) { aClient = new AcceptClient(); @@ -123,9 +124,7 @@ } } - private void setArguments(String[] mainArgs) { - } - +/* private void cleanUpSession() { if (prevVps != null) { prevVps.cleanUpSession(); @@ -133,7 +132,7 @@ } // workingProtocol.cleanUpSession(); } - +*/ public void createConnectionAndStart() { Thread thread; opendPort = myRfb.selectPort(5999); @@ -141,11 +140,13 @@ acceptThread = new AcceptThread(myRfb, opendPort); thread = new Thread(acceptThread); thread.start(); - getCast = new GetBroadCastProxy(this, - this.connectionParams.getHostName(), - this.connectionParams.getHostName()); - thread = new Thread(getCast); - thread.start(); + if(firstTime) { + getCast = new GetBroadCastProxy(this, + this.connectionParams.getHostName(), + this.connectionParams.getHostName()); + thread = new Thread(getCast); + thread.start(); + } } public void proxyStart(String[] argv, int width, int height) { @@ -275,6 +276,7 @@ throws UnknownHostException, IOException { // sender and reader stop VncProxyService newVps = new VncProxyService(this, hostName); + newVps.setFirstTime(false); // newVps.fbWidth = width; // newVps.fbHeight = height; // run call and change workingProtocol @@ -289,6 +291,10 @@ } + public void setFirstTime(boolean flag) { + firstTime = flag; + } + public void orderRecconection(VncProxyService vps,String hostName) throws UnknownHostException, IOException { int count = 0; while(true) {
--- a/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Mon Mar 10 22:41:30 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/Viewer.java Tue Mar 11 15:29:52 2014 +0900 @@ -44,11 +44,8 @@ import java.util.jar.Manifest; import java.util.logging.*; -import jp.ac.u_ryukyu.treevnc.AcceptThread; import jp.ac.u_ryukyu.treevnc.CreateConnectionParam; import jp.ac.u_ryukyu.treevnc.MyRfbProto; -import jp.ac.u_ryukyu.treevnc.client.GetDataClient; -import jp.ac.u_ryukyu.treevnc.client.GetHostClient; import jp.ac.u_ryukyu.treevnc.client.MyRfbProtoClient; @SuppressWarnings("serial") @@ -226,10 +223,6 @@ public void showView() { /*nop*/ } @Override public void closeView() { /*nop*/ } - @SuppressWarnings("UnusedDeclaration") - public void setMessage(String message) { - Viewer.this.getAppletContext().showStatus(message); - } }); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/ViewerImpl.java Mon Mar 10 22:41:30 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/ViewerImpl.java Tue Mar 11 15:29:52 2014 +0900 @@ -3,7 +3,6 @@ import java.net.Socket; import jp.ac.u_ryukyu.treevnc.MyRfbProto; -import jp.ac.u_ryukyu.treevnc.server.MyRfbProtoProxy; public interface ViewerImpl {