Revision: 4891 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4891&view=rev Author: bphinz Date: 2012-04-14 03:20:47 +0000 (Sat, 14 Apr 2012) Log Message: ----------- Allows java client in listen mode to continue listening and spawning new viewers after the first connection is made.
Modified Paths: -------------- trunk/java/com/tigervnc/vncviewer/VncViewer.java Modified: trunk/java/com/tigervnc/vncviewer/VncViewer.java =================================================================== --- trunk/java/com/tigervnc/vncviewer/VncViewer.java 2012-04-13 01:36:45 UTC (rev 4890) +++ trunk/java/com/tigervnc/vncviewer/VncViewer.java 2012-04-14 03:20:47 UTC (rev 4891) @@ -228,13 +228,17 @@ firstApplet = true; } - public static void newViewer(VncViewer oldViewer) { + public static void newViewer(VncViewer oldViewer, Socket sock) { VncViewer viewer = new VncViewer(); viewer.applet = oldViewer.applet; viewer.firstApplet = false; + viewer.sock = sock; viewer.start(); } + public static void newViewer(VncViewer oldViewer) { + newViewer(oldViewer, null); + } public void init() { vlog.debug("init called"); @@ -289,7 +293,6 @@ public void run() { CConn cc = null; - Socket sock = null; /* Tunnelling support. */ if (via.getValueStr() != null) { @@ -324,10 +327,9 @@ vlog.info("Listening on port "+port); while (true) { - sock = listener.accept(); - if (sock != null) - break; - //listener.close(); + Socket new_sock = listener.accept(); + if (new_sock != null) + newViewer(this, new_sock); } } @@ -456,6 +458,7 @@ 8); Thread thread; + Socket sock; boolean applet, firstApplet, stop; Image logo; static int nViewers; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits