changeset 26:072306e78a95

stop send png data
author e085711
date Thu, 23 Jun 2011 04:48:16 +0900
parents 49eed04b9b3b
children 53c831c3a513
files src/myVncClient/MyVncClient.java src/myVncClient/VncCanvas.java src/myVncClient/VncViewer.java
diffstat 3 files changed, 30 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/myVncClient/MyVncClient.java	Wed Jun 15 15:30:33 2011 +0900
+++ b/src/myVncClient/MyVncClient.java	Thu Jun 23 04:48:16 2011 +0900
@@ -5,6 +5,8 @@
 import java.io.*;
 import java.net.*;
 
+import myVncClient.acceptThread;
+
 public class MyVncClient extends VncViewer implements
 		java.lang.Runnable, WindowListener {
 
@@ -26,6 +28,8 @@
 		v.start();
 	}
 
+	
+	
 	//
 	// init()
 	//
@@ -64,6 +68,10 @@
 
 		rfbThread = new Thread(this);
 		rfbThread.start();
+		accThread = new Thread(new acceptThread(rfb)); 
+		accThread.start();
+		
+		
 	}
 
 	public void update(Graphics g) {
@@ -96,10 +104,12 @@
 
 			rfb = new MyRfbProto(host, port, this);
 			rfb.readServerInit();
-			rfb.readPngData();
 			
 			createCanvas(0, 0);
-			vc.drawFirstImage();
+
+			// read & draw Png Data
+//			rfb.readPngData();
+//			vc.drawFirstImage();
 
 			
 		} catch (IOException e) {
--- a/src/myVncClient/VncCanvas.java	Wed Jun 15 15:30:33 2011 +0900
+++ b/src/myVncClient/VncCanvas.java	Thu Jun 23 04:48:16 2011 +0900
@@ -384,16 +384,19 @@
 
 		long count = 0;
 		
+/*
 		Thread accept = new Thread(new acceptThread(rfb));
 		accept.start();
-
+*/
+		
 		while (true) {
 //			System.out.println("\ncount=" + count);
 			count++;
 			
 			rfb.regiFramebufferUpdate();
 			rfb.checkAndMark();
-//			rfb.readSendData();
+//			rfb.printFramebufferUpdate();
+			rfb.readSendData();
 			
 			int bufSize = (int)rfb.getNumBytesRead();
 			
@@ -549,7 +552,7 @@
 			
 			bufSize = (int)rfb.getNumBytesRead() - bufSize;
 //			System.out.println("bufSize="+bufSize);
-			rfb.bufResetSend(bufSize);
+//			rfb.bufResetSend(bufSize);
 
 			
 			if(rfb.createBimgFlag){
--- a/src/myVncClient/VncViewer.java	Wed Jun 15 15:30:33 2011 +0900
+++ b/src/myVncClient/VncViewer.java	Thu Jun 23 04:48:16 2011 +0900
@@ -30,6 +30,8 @@
 
 	MyRfbProto rfb;
 	Thread rfbThread;
+	Thread accThread;
+	
 
 	Frame vncFrame;
 	Container vncContainer;
@@ -105,6 +107,10 @@
 
 		rfbThread = new Thread(this);
 		rfbThread.start();
+		accThread = new Thread(new acceptThread(rfb)); 
+		accThread.start();
+		
+		
 	}
 
 	public void update(Graphics g) {
@@ -665,8 +671,12 @@
 		host = readParameter("HOST", !inAnApplet);
 
 
-		if (host == null) { host = getCodeBase().getHost(); if
-		(host.equals("")) { fatalError("HOST parameter not specified"); } }
+		if (host == null) { host = getCodeBase().getHost(); 
+			if (host.equals("")) {
+				host = "nw0811.st.ie.u-ryukyu.ac.jp";
+//				fatalError("HOST parameter not specified"); 	
+			} 
+		}
 
 		port = readIntParameter("PORT", 5550);