Mercurial > hg > Applications > TreeVNC
changeset 181:9c02b5a72bf9
fix root myAddress.
author | oc |
---|---|
date | Mon, 23 Jun 2014 17:59:07 +0900 |
parents | 96fcfe560edb |
children | b3426724667b |
files | src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java Mon Jun 23 17:16:05 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java Mon Jun 23 17:59:07 2014 +0900 @@ -273,6 +273,7 @@ try { servSock = new ServerSocket(port); acceptPort = port; + myAddress = "127.0.0.1"; break; } catch (BindException e) { port++;
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jun 23 17:16:05 2014 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java Mon Jun 23 17:59:07 2014 +0900 @@ -44,6 +44,8 @@ import java.awt.*; import java.awt.event.*; +import java.io.IOException; +import java.net.UnknownHostException; import java.util.LinkedList; import java.util.List; import java.util.concurrent.Executors; @@ -833,6 +835,14 @@ // before change server, data from previous server // should be stopped. viewer.setCuiVersion(true); + if (viewer.getRfb().isRoot()) { + try { + viewer.getRfb().changeVNCServer(viewer, "localhost", 1980, 1090, viewer.getRfb().getId()); + } catch (Exception e1) { + System.out.println("can't change server :" + e1.getMessage()); + } + return; + } String adr = viewer.getRfb().getMyAddress(); context.sendMessage(new ScreenChangeRequest(adr, viewer.getRfb().getId())); }