diff src/VncViewer.java @ 10:2840c7a259f1

add acceptThread
author e085711
date Sat, 16 Apr 2011 02:21:09 +0900
parents c0ad3ecdf827
children 2869ca1579ae
line wrap: on
line diff
--- a/src/VncViewer.java	Sat Apr 16 01:19:18 2011 +0900
+++ b/src/VncViewer.java	Sat Apr 16 02:21:09 2011 +0900
@@ -56,7 +56,7 @@
 
 	String[] mainArgs;
 
-//	RfbProto rfb;
+	// RfbProto rfb;
 	MyRfbProto rfb;
 	Thread rfbThread;
 
@@ -325,7 +325,7 @@
 
 		showConnectionStatus("Connecting to " + host + ", port " + port + "...");
 
-//		rfb = new RfbProto(host, port, this);
+		// rfb = new RfbProto(host, port, this);
 		rfb = new MyRfbProto(host, port, this);
 		showConnectionStatus("Connected to server");
 
@@ -449,8 +449,16 @@
 
 		if (rfb.MYVNC) {
 			rfb.initServSock(5550);
-			rfb.setSoTimeout(10);
-//			rfb.accept();
+			// rfb.setSoTimeout(10);
+
+			try {
+				Socket newCli = rfb.accept();
+				rfb.sendInitData(newCli);
+				rfb.addSock(newCli);
+			} catch (IOException e) {
+			}
+
+
 		}
 
 		System.out.println("Desktop name is " + rfb.desktopName);