changeset 56:9f8463fb1d4d

merge
author Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
date Thu, 28 Jul 2011 18:07:21 +0900
parents f2f4b0398f04 (current diff) c9ef47d9aa55 (diff)
children e65934744da8
files src/myVncClient/MyVncClient.java src/myVncClient/acceptThread.java
diffstat 5 files changed, 34 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/myVncClient/AcceptThread.java	Thu Jul 28 18:07:21 2011 +0900
@@ -0,0 +1,31 @@
+package myVncClient;
+import java.net.Socket;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import myVncClient.MyRfbProto;
+
+public class AcceptThread implements Runnable {
+    MyRfbProto rfb;
+    byte[] imageBytes;
+
+    AcceptThread(MyRfbProto _rfb ) {
+	rfb = _rfb;
+    }
+    public void run() {
+	rfb.selectPort();
+	while (true) {
+	    try {
+		Socket newCli = rfb.accept();
+		
+		OutputStream os = newCli.getOutputStream();
+		InputStream is = newCli.getInputStream();
+		rfb.newClient(this, newCli, os, is);
+	    } catch (IOException e) {
+		e.printStackTrace();
+		System.out.println(e);
+	    }
+	}
+    }
+}
\ No newline at end of file
--- a/src/myVncClient/MyRfbProto.java	Thu Jul 28 18:06:46 2011 +0900
+++ b/src/myVncClient/MyRfbProto.java	Thu Jul 28 18:07:21 2011 +0900
@@ -434,7 +434,7 @@
 		}
 	}
 
-	void newClient(acceptThread acceptThread, final Socket newCli,
+	void newClient(AcceptThread acceptThread, final Socket newCli,
 			final OutputStream os, final InputStream is) throws IOException {
 		// createBimgFlag = true;
 		// rfb.addSockTmp(newCli);
--- a/src/myVncClient/MyVncClient.java	Thu Jul 28 18:06:46 2011 +0900
+++ b/src/myVncClient/MyVncClient.java	Thu Jul 28 18:07:21 2011 +0900
@@ -6,7 +6,6 @@
 import java.net.*;
 import java.util.Random;
 
-import myVncClient.acceptThread;
 
 public class MyVncClient extends VncViewer implements java.lang.Runnable,
 		WindowListener {
@@ -112,7 +111,7 @@
 		try {
 
 			connectAndAuthenticate();
-			accThread = new Thread(new acceptThread(rfb));
+			accThread = new Thread(new AcceptThread(rfb));
 			accThread.start();
 
 			doProtocolInitialisation();
--- a/src/myVncClient/VncViewer.java	Thu Jul 28 18:06:46 2011 +0900
+++ b/src/myVncClient/VncViewer.java	Thu Jul 28 18:07:21 2011 +0900
@@ -108,7 +108,7 @@
 
 		rfbThread = new Thread(this);
 		rfbThread.start();
-		accThread = new Thread(new acceptThread(rfb)); 
+		accThread = new Thread(new AcceptThread(rfb)); 
 		accThread.start();
 		
 		
--- a/src/myVncClient/acceptThread.java	Thu Jul 28 18:06:46 2011 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-package myVncClient;
-import java.net.Socket;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import myVncClient.MyRfbProto;
-
-public class acceptThread implements Runnable {
-	MyRfbProto rfb;
-	byte[] imageBytes;
-
-	acceptThread(MyRfbProto _rfb ) {
-		rfb = _rfb;
-	}
-	public void run() {
-		rfb.selectPort();
-		while (true) {
-			try {
-				Socket newCli = rfb.accept();
-				
-				OutputStream os = newCli.getOutputStream();
-				InputStream is = newCli.getInputStream();
-				rfb.newClient(this, newCli, os, is);
-				} catch (IOException e) {
-				e.printStackTrace();
-				System.out.println(e);
-			}
-		}
-	}
-}
\ No newline at end of file