Mercurial > hg > Applications > TreeVNC
annotate src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java @ 111:a7988d3c0266
minor fix.
author | oc |
---|---|
date | Fri, 23 May 2014 20:24:43 +0900 |
parents | 464eb64e3fd6 |
children | 918dc3ee1c79 |
rev | line source |
---|---|
32 | 1 package jp.ac.u_ryukyu.treevnc; |
28 | 2 |
3 import java.io.IOException; | |
4 import java.net.Socket; | |
5 import java.nio.ByteBuffer; | |
109 | 6 import java.nio.ByteOrder; |
28 | 7 import java.util.LinkedList; |
8 import java.util.concurrent.atomic.AtomicInteger; | |
9 | |
35 | 10 import jp.ac.u_ryukyu.treevnc.client.EchoClient; |
28 | 11 import jp.ac.u_ryukyu.treevnc.server.RequestScreenThread; |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
12 import jp.ac.u_ryukyu.treevnc.server.VncProxyService; |
28 | 13 |
14 import com.glavsoft.exceptions.TransportException; | |
107 | 15 import com.glavsoft.rfb.client.ClientToServerMessage; |
96 | 16 import com.glavsoft.rfb.encoding.EncodingType; |
28 | 17 import com.glavsoft.rfb.protocol.Protocol; |
18 import com.glavsoft.rfb.protocol.ProtocolContext; | |
19 import com.glavsoft.transport.Reader; | |
20 import com.glavsoft.transport.Writer; | |
65 | 21 import com.glavsoft.viewer.ViewerImpl; |
28 | 22 |
23 public class MyRfbProto { | |
33
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
24 final static int FramebufferUpdateRequest = 3; |
28 | 25 final static int CheckDelay = 11; |
103 | 26 protected final static int FramebufferUpdate = 0; |
28 | 27 private ProtocolContext context; |
103 | 28 protected final static String versionMsg_3_856 = "RFB 003.856\n"; |
28 | 29 private int clients; |
98 | 30 public MulticastQueue<LinkedList<ByteBuffer>> multicastqueue = new MulticastQueue<LinkedList<ByteBuffer>>(); |
28 | 31 private RequestScreenThread rThread; |
32 private boolean proxyFlag = true; | |
35 | 33 private EchoClient echo; |
45 | 34 private String proxyAddr; |
60 | 35 public int acceptPort; |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
36 protected boolean readyReconnect = false; |
98 | 37 private boolean cuiVersion; |
107 | 38 private long counter = 0; // packet serial number |
39 private VncProxyService viewer = null; | |
40 | |
33
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
41 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
42 public MyRfbProto() { |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
43 rThread = new RequestScreenThread(this); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
44 } |
107 | 45 |
111 | 46 public void setVncProxy(VncProxyService viewer) { |
107 | 47 this.viewer = viewer; |
48 } | |
28 | 49 |
103 | 50 public boolean isRoot() { |
51 return false; | |
52 } | |
28 | 53 |
54 public void newClient(AcceptThread acceptThread, final Socket newCli, | |
55 final Writer os, final Reader is) throws IOException { | |
56 // createBimgFlag = true; | |
57 // rfb.addSockTmp(newCli); | |
58 // addSock(newCli); | |
59 final int myId = clients; | |
60 final MulticastQueue.Client<LinkedList<ByteBuffer>> c = multicastqueue.newClient(); | |
61 final AtomicInteger writerRunning = new AtomicInteger(); | |
62 writerRunning.set(1); | |
63 /** | |
64 * Timeout thread. If a client is suspended, it has top of queue | |
65 * indefinitely, which caused memory overflow. After the timeout, we | |
66 * poll the queue and discard it. Start long wait if writer is running. | |
67 */ | |
68 final Runnable timer = new Runnable() { | |
69 public void run() { | |
70 int count = 0; | |
71 for (;;) { | |
72 long timeout = 50000 / 8; | |
73 try { | |
74 synchronized (this) { | |
75 int state, flag; | |
76 writerRunning.set(0); | |
77 wait(timeout); | |
78 flag = 0; | |
79 while ((state = writerRunning.get()) == 0) { | |
80 c.poll(); // discard, should be timeout | |
81 count++; | |
82 if (flag == 0) { | |
83 System.out.println("Discarding " + myId | |
84 + " count=" + count); | |
85 flag = 1; | |
86 } | |
87 wait(10); // if this is too short, writer cannot | |
88 // take the poll, if this is too | |
89 // long, memory will overflow... | |
90 } | |
91 if (flag == 1) | |
92 System.out.println("Resuming " + myId | |
93 + " count=" + count); | |
94 if (state != 1) { | |
95 System.out.println("Client died " + myId); | |
96 break; | |
97 } | |
98 } | |
99 } catch (InterruptedException e) { | |
100 } | |
101 } | |
102 } | |
103 }; | |
88 | 104 new Thread(timer, "timer-discard-multicastqueue").start(); |
28 | 105 /** |
107 | 106 * send all incoming from clients to parent. |
28 | 107 */ |
108 final Runnable reader = new Runnable() { | |
107 | 109 |
110 | |
28 | 111 public void run() { |
112 byte b[] = new byte[4096]; | |
113 for (;;) { | |
114 try { | |
115 int c = is.readByte(b); | |
116 if (c <= 0) | |
117 throw new IOException(); | |
107 | 118 if (isRoot()) { |
119 if (b[0] == ClientToServerMessage.SERVER_CHANGE_REQUEST) { | |
120 if (permitChangeScreen()) { | |
109 | 121 ByteBuffer buf = ByteBuffer.wrap(b); |
122 buf.order(ByteOrder.BIG_ENDIAN); | |
123 int length = buf.getInt(4); | |
107 | 124 if (length == 0) |
125 continue; | |
126 String newHostName = new String(b, 8, length); | |
111 | 127 System.out.println("Root server change request :" + newHostName); |
107 | 128 // please remove these numbers. |
129 if (viewer != null) { | |
130 viewer.changeVNCServer(newHostName, 3200, 1980); | |
131 } | |
132 } else { | |
133 continue; | |
134 } | |
135 } | |
110 | 136 } else if (b[0] == ClientToServerMessage.SERVER_CHANGE_REQUEST) { |
107 | 137 context.getWriter().write(b); |
138 } | |
28 | 139 // System.out.println("client read "+c); |
89 | 140 } catch (Exception e) { |
28 | 141 try { |
142 writerRunning.set(2); | |
143 os.close(); | |
144 is.close(); | |
36 | 145 break; |
28 | 146 } catch (IOException e1) { |
147 } catch (TransportException e1) { | |
148 e1.printStackTrace(); | |
149 } | |
150 return; | |
151 } | |
152 } | |
153 } | |
107 | 154 |
155 private boolean permitChangeScreen() { | |
109 | 156 return true; |
107 | 157 } |
28 | 158 }; |
159 /** | |
160 * send packets to a client | |
161 */ | |
162 Runnable sender = new Runnable() { | |
163 public void run() { | |
164 writerRunning.set(1); | |
165 try { | |
166 requestThreadNotify(); | |
167 | |
168 /** | |
169 * initial connection of RFB protocol | |
170 */ | |
171 sendRfbVersion(os); | |
172 // readVersionMsg(is); | |
173 readVersionMsg(is, os); | |
174 sendSecurityType(os); | |
175 readSecType(is); | |
176 sendSecResult(os); | |
177 readClientInit(is); | |
178 sendInitData(os); | |
88 | 179 // after this, we discard upward packet. |
180 new Thread(reader, "discard-upward-comm").start(); | |
28 | 181 // writeFramebufferUpdateRequest(0,0, framebufferWidth, |
182 // framebufferHeight, false ); | |
183 for (;;) { | |
184 LinkedList<ByteBuffer> bufs = c.poll(); | |
185 int inputIndex = 0; | |
186 ByteBuffer header = bufs.get(inputIndex); | |
187 if (header == null) | |
188 continue; | |
189 else if (header.get(0) == CheckDelay) { | |
190 writeToClient(os, bufs, inputIndex); | |
191 continue; | |
192 } else if (header.get(0) == FramebufferUpdate) { | |
63 | 193 //System.out.println("client "+ myId); |
28 | 194 } |
195 /* | |
196 * if(i%20==0){ sendDataCheckDelay(); } i++; | |
197 */ | |
198 writeToClient(os, bufs, inputIndex); | |
199 writerRunning.set(1); // yes my client is awaking. | |
200 } | |
89 | 201 } catch (Exception e) { |
28 | 202 try { |
203 writerRunning.set(2); | |
204 os.close(); | |
205 } catch (IOException e1) { | |
206 } | |
207 /* if socket closed cliList.remove(newCli); */ | |
208 } | |
209 } | |
210 | |
211 public void writeToClient(final Writer os, | |
212 LinkedList<ByteBuffer> bufs, int inputIndex) | |
213 throws TransportException { | |
214 while (inputIndex < bufs.size()) { | |
215 ByteBuffer b = bufs.get(inputIndex++); | |
216 os.write(b.array(), b.position(), b.limit()); | |
217 } | |
218 os.flush(); | |
74 | 219 bufs = null; |
220 multicastqueue.heapAvailable(); | |
28 | 221 } |
222 }; | |
223 clients++; | |
88 | 224 new Thread(sender, "writer-to-lower-node").start(); |
28 | 225 |
226 } | |
227 | |
88 | 228 public void requestThreadNotify() { |
28 | 229 rThread.reStart(); |
230 } | |
231 | |
232 private void sendRfbVersion(Writer writer) throws IOException, TransportException { | |
233 // os.write(versionMsg_3_8.getBytes()); | |
54 | 234 writer.write(versionMsg_3_856.getBytes()); |
28 | 235 } |
236 | |
237 private int readVersionMsg(Reader reader, Writer writer) throws IOException, TransportException { | |
238 | |
239 byte[] b = new byte[12]; | |
240 | |
241 reader.readBytes(b); | |
242 | |
243 if ((b[0] != 'R') || (b[1] != 'F') || (b[2] != 'B') || (b[3] != ' ') | |
244 || (b[4] < '0') || (b[4] > '9') || (b[5] < '0') || (b[5] > '9') | |
245 || (b[6] < '0') || (b[6] > '9') || (b[7] != '.') | |
246 || (b[8] < '0') || (b[8] > '9') || (b[9] < '0') || (b[9] > '9') | |
247 || (b[10] < '0') || (b[10] > '9') || (b[11] != '\n')) { | |
248 throw new IOException("this is not an RFB server"); | |
249 } | |
250 | |
251 int rfbMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0'); | |
252 int rfbMinor = (b[8] - '0') * 100 + (b[9] - '0') * 10 + (b[10] - '0'); | |
253 | |
254 if (rfbMajor < 3) { | |
255 throw new IOException( | |
256 "RFB server does not support protocol version 3"); | |
257 } | |
258 | |
259 if (rfbMinor == 855) { | |
260 sendProxyFlag(writer); | |
261 if (proxyFlag) | |
262 sendPortNumber(writer); | |
263 } | |
264 return rfbMinor; | |
265 } | |
45 | 266 |
107 | 267 public void screenChangeRequest() throws TransportException { |
268 new ScreenChangeRequest(echo.getMyAddress().getBytes()).send(context.getWriter()); | |
45 | 269 } |
28 | 270 |
271 private void sendProxyFlag(Writer writer) throws TransportException { | |
272 if (proxyFlag) | |
273 writer.writeInt(1); | |
274 else | |
275 writer.writeInt(0); | |
276 } | |
277 | |
278 private void sendPortNumber(Writer writer) throws TransportException { | |
279 byte[] b = new byte[4]; | |
280 //b = castIntByte(getHost.getPort()); | |
281 b = castIntByte(9999); | |
282 writer.write(b); | |
283 } | |
284 | |
285 private byte[] castIntByte(int len) { | |
286 byte[] b = new byte[4]; | |
287 b[0] = (byte) ((len >>> 24) & 0xFF); | |
288 b[1] = (byte) ((len >>> 16) & 0xFF); | |
289 b[2] = (byte) ((len >>> 8) & 0xFF); | |
290 b[3] = (byte) ((len >>> 0) & 0xFF); | |
291 return b; | |
292 } | |
293 | |
45 | 294 |
28 | 295 private void readSecType(Reader reader) throws TransportException { |
296 byte[] b = new byte[1]; | |
297 reader.read(b); | |
298 } | |
299 | |
300 private void sendSecurityType(Writer os) throws TransportException { | |
301 // number-of-security-types | |
302 os.writeInt(1); | |
303 // security-types | |
304 // 1:None | |
305 os.writeInt(1); | |
306 | |
307 /* | |
308 * os.write(4); os.write(30); os.write(31); os.write(32); os.write(35); | |
309 * os.flush(); | |
310 */ | |
311 } | |
312 | |
313 private void sendSecResult(Writer os) throws TransportException { | |
314 byte[] b = castIntByte(0); | |
315 os.write(b); | |
316 } | |
317 | |
318 private void readClientInit(Reader in) throws TransportException { | |
319 byte[] b = new byte[0]; | |
320 in.readBytes(b); | |
321 } | |
322 | |
85 | 323 byte initData[] = {7, -128, 4, 56, 32, 24, 0, 1, 0, -1, 0, -1, 0, -1, 16, 8, 0, 0, 0, 0, 0, 0, 0, 7, 102, 105, 114, 101, 102, 108, 121}; |
28 | 324 private void sendInitData(Writer os) throws TransportException { |
85 | 325 // In case of "-d" we have no context |
326 if (context != null){ | |
327 os.write(context.getInitData()); | |
328 } else { | |
329 // Send dummy data | |
330 os.write(initData); | |
331 } | |
28 | 332 } |
333 | |
334 public void setProtocolContext(Protocol workingProtocol) { | |
335 context = workingProtocol; | |
336 } | |
29 | 337 |
338 | |
339 public void readSendData(int dataLen, Reader reader) throws TransportException { | |
340 | |
341 } | |
31 | 342 |
343 public Socket accept() throws IOException { | |
344 return null; | |
345 } | |
346 | |
38 | 347 public int selectPort(int port) { |
348 return port; | |
31 | 349 } |
33
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
350 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
351 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
352 public void writeFramebufferUpdateRequest(int x, int y, int w, int h, |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
353 boolean incremental) throws TransportException { |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
354 byte[] b = new byte[10]; |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
355 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
356 b[0] = (byte) FramebufferUpdateRequest; // 3 is FrameBufferUpdateRequest |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
357 b[1] = (byte) (incremental ? 1 : 0); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
358 b[2] = (byte) ((x >> 8) & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
359 b[3] = (byte) (x & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
360 b[4] = (byte) ((y >> 8) & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
361 b[5] = (byte) (y & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
362 b[6] = (byte) ((w >> 8) & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
363 b[7] = (byte) (w & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
364 b[8] = (byte) ((h >> 8) & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
365 b[9] = (byte) (h & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
366 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
367 // os.write(b); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
368 } |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
369 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
370 public void notProxy() { |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
371 proxyFlag = false; |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
372 } |
35 | 373 |
374 public void setEcho(EchoClient _echo) { | |
375 echo = _echo; | |
376 } | |
377 | |
65 | 378 public void setViewer(ViewerImpl v) { |
36 | 379 echo.setViewer(v); |
380 } | |
381 | |
65 | 382 public ViewerImpl getViewer() { |
383 return echo.getViewer(); | |
384 } | |
385 | |
35 | 386 public EchoClient getEcho() { |
387 return echo; | |
388 } | |
43 | 389 |
390 public void setTerminationType(boolean setType) { | |
391 /*nop*/ | |
392 } | |
393 | |
394 public boolean getTerminationType() { | |
395 /*nop*/ | |
396 return true; | |
397 } | |
45 | 398 |
399 public void setProxyAddr(String proxyAddr) { | |
400 this.proxyAddr = proxyAddr; | |
401 } | |
52 | 402 |
403 | |
404 public void close() { | |
102
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
405 // none |
52 | 406 } |
45 | 407 |
60 | 408 public int getAcceptPort() { |
409 return 0; | |
410 } | |
411 | |
61
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
412 public boolean getReadyReconnect() { |
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
413 return readyReconnect; |
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
414 } |
65 | 415 |
416 | |
417 public boolean getCuiVersion() { | |
418 return cuiVersion; | |
61
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
419 } |
65 | 420 |
421 public void setCuiVersion(boolean flag) { | |
422 cuiVersion = flag; | |
423 } | |
66 | 424 |
425 public void readCheckDelay(Reader reader) throws TransportException { | |
426 | |
427 } | |
428 | |
429 public String getProxyAddr() { | |
430 return proxyAddr; | |
431 } | |
65 | 432 |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
433 public synchronized void setReadyReconnect(boolean ready) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
434 readyReconnect = ready; |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
435 if (ready) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
436 notifyAll(); |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
437 } |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
438 } |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
439 |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
440 public synchronized void waitForReady(VncProxyService vncProxyService) throws InterruptedException { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
441 while (!readyReconnect) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
442 wait(); |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
443 } |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
444 } |
96 | 445 |
446 | |
447 public void sendDesktopSizeChange() { | |
448 LinkedList<ByteBuffer> desktopSize = new LinkedList<ByteBuffer>(); | |
97 | 449 int width = context.getFbWidth(); |
450 int height = context.getFbHeight(); | |
451 desktopSize.add(new UpdateRectangleMessage(0,0, width, height, EncodingType.DESKTOP_SIZE).getMessage()); | |
99 | 452 addSerialNumber(desktopSize); |
96 | 453 multicastqueue.put(desktopSize); |
454 } | |
98 | 455 |
456 | |
457 public void addSerialNumber(LinkedList<ByteBuffer> bufs) { | |
458 ByteBuffer serialNum = multicastqueue.allocate(8); | |
459 serialNum.putLong(counter++); | |
460 serialNum.flip(); | |
461 bufs.addFirst(serialNum); | |
462 } | |
102
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
463 |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
464 |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
465 public void resetDecoder() { |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
466 context.resetDecoder(); |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
467 } |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
468 |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
469 public void stopReceiverTask() { |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
470 if (context!=null) |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
471 context.cleanUpSession(null); |
1f7ee648e1f6
inflator in MyRfbProtoProxy should be renew to accept new VNC server socket.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
99
diff
changeset
|
472 } |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
473 |
28 | 474 } |