Mercurial > hg > Applications > TreeVNC
annotate src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java @ 110:464eb64e3fd6
minor fix.
author | oc |
---|---|
date | Fri, 23 May 2014 19:58:35 +0900 |
parents | 457f9dfbf7ce |
children | a7988d3c0266 |
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 |
46 public void setViewer(VncProxyService viewer) { | |
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); | |
127 // please remove these numbers. | |
128 if (viewer != null) { | |
129 viewer.changeVNCServer(newHostName, 3200, 1980); | |
130 } | |
131 } else { | |
132 continue; | |
133 } | |
134 } | |
110 | 135 } else if (b[0] == ClientToServerMessage.SERVER_CHANGE_REQUEST) { |
107 | 136 context.getWriter().write(b); |
137 } | |
28 | 138 // System.out.println("client read "+c); |
89 | 139 } catch (Exception e) { |
28 | 140 try { |
141 writerRunning.set(2); | |
142 os.close(); | |
143 is.close(); | |
36 | 144 break; |
28 | 145 } catch (IOException e1) { |
146 } catch (TransportException e1) { | |
147 e1.printStackTrace(); | |
148 } | |
149 return; | |
150 } | |
151 } | |
152 } | |
107 | 153 |
154 private boolean permitChangeScreen() { | |
109 | 155 return true; |
107 | 156 } |
28 | 157 }; |
158 /** | |
159 * send packets to a client | |
160 */ | |
161 Runnable sender = new Runnable() { | |
162 public void run() { | |
163 writerRunning.set(1); | |
164 try { | |
165 requestThreadNotify(); | |
166 | |
167 /** | |
168 * initial connection of RFB protocol | |
169 */ | |
170 sendRfbVersion(os); | |
171 // readVersionMsg(is); | |
172 readVersionMsg(is, os); | |
173 sendSecurityType(os); | |
174 readSecType(is); | |
175 sendSecResult(os); | |
176 readClientInit(is); | |
177 sendInitData(os); | |
88 | 178 // after this, we discard upward packet. |
179 new Thread(reader, "discard-upward-comm").start(); | |
28 | 180 // writeFramebufferUpdateRequest(0,0, framebufferWidth, |
181 // framebufferHeight, false ); | |
182 for (;;) { | |
183 LinkedList<ByteBuffer> bufs = c.poll(); | |
184 int inputIndex = 0; | |
185 ByteBuffer header = bufs.get(inputIndex); | |
186 if (header == null) | |
187 continue; | |
188 else if (header.get(0) == CheckDelay) { | |
189 writeToClient(os, bufs, inputIndex); | |
190 continue; | |
191 } else if (header.get(0) == FramebufferUpdate) { | |
63 | 192 //System.out.println("client "+ myId); |
28 | 193 } |
194 /* | |
195 * if(i%20==0){ sendDataCheckDelay(); } i++; | |
196 */ | |
197 writeToClient(os, bufs, inputIndex); | |
198 writerRunning.set(1); // yes my client is awaking. | |
199 } | |
89 | 200 } catch (Exception e) { |
28 | 201 try { |
202 writerRunning.set(2); | |
203 os.close(); | |
204 } catch (IOException e1) { | |
205 } | |
206 /* if socket closed cliList.remove(newCli); */ | |
207 } | |
208 } | |
209 | |
210 public void writeToClient(final Writer os, | |
211 LinkedList<ByteBuffer> bufs, int inputIndex) | |
212 throws TransportException { | |
213 while (inputIndex < bufs.size()) { | |
214 ByteBuffer b = bufs.get(inputIndex++); | |
215 os.write(b.array(), b.position(), b.limit()); | |
216 } | |
217 os.flush(); | |
74 | 218 bufs = null; |
219 multicastqueue.heapAvailable(); | |
28 | 220 } |
221 }; | |
222 clients++; | |
88 | 223 new Thread(sender, "writer-to-lower-node").start(); |
28 | 224 |
225 } | |
226 | |
88 | 227 public void requestThreadNotify() { |
28 | 228 rThread.reStart(); |
229 } | |
230 | |
231 private void sendRfbVersion(Writer writer) throws IOException, TransportException { | |
232 // os.write(versionMsg_3_8.getBytes()); | |
54 | 233 writer.write(versionMsg_3_856.getBytes()); |
28 | 234 } |
235 | |
236 private int readVersionMsg(Reader reader, Writer writer) throws IOException, TransportException { | |
237 | |
238 byte[] b = new byte[12]; | |
239 | |
240 reader.readBytes(b); | |
241 | |
242 if ((b[0] != 'R') || (b[1] != 'F') || (b[2] != 'B') || (b[3] != ' ') | |
243 || (b[4] < '0') || (b[4] > '9') || (b[5] < '0') || (b[5] > '9') | |
244 || (b[6] < '0') || (b[6] > '9') || (b[7] != '.') | |
245 || (b[8] < '0') || (b[8] > '9') || (b[9] < '0') || (b[9] > '9') | |
246 || (b[10] < '0') || (b[10] > '9') || (b[11] != '\n')) { | |
247 throw new IOException("this is not an RFB server"); | |
248 } | |
249 | |
250 int rfbMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0'); | |
251 int rfbMinor = (b[8] - '0') * 100 + (b[9] - '0') * 10 + (b[10] - '0'); | |
252 | |
253 if (rfbMajor < 3) { | |
254 throw new IOException( | |
255 "RFB server does not support protocol version 3"); | |
256 } | |
257 | |
258 if (rfbMinor == 855) { | |
259 sendProxyFlag(writer); | |
260 if (proxyFlag) | |
261 sendPortNumber(writer); | |
262 } | |
263 return rfbMinor; | |
264 } | |
45 | 265 |
107 | 266 public void screenChangeRequest() throws TransportException { |
267 new ScreenChangeRequest(echo.getMyAddress().getBytes()).send(context.getWriter()); | |
45 | 268 } |
28 | 269 |
270 private void sendProxyFlag(Writer writer) throws TransportException { | |
271 if (proxyFlag) | |
272 writer.writeInt(1); | |
273 else | |
274 writer.writeInt(0); | |
275 } | |
276 | |
277 private void sendPortNumber(Writer writer) throws TransportException { | |
278 byte[] b = new byte[4]; | |
279 //b = castIntByte(getHost.getPort()); | |
280 b = castIntByte(9999); | |
281 writer.write(b); | |
282 } | |
283 | |
284 private byte[] castIntByte(int len) { | |
285 byte[] b = new byte[4]; | |
286 b[0] = (byte) ((len >>> 24) & 0xFF); | |
287 b[1] = (byte) ((len >>> 16) & 0xFF); | |
288 b[2] = (byte) ((len >>> 8) & 0xFF); | |
289 b[3] = (byte) ((len >>> 0) & 0xFF); | |
290 return b; | |
291 } | |
292 | |
45 | 293 |
28 | 294 private void readSecType(Reader reader) throws TransportException { |
295 byte[] b = new byte[1]; | |
296 reader.read(b); | |
297 } | |
298 | |
299 private void sendSecurityType(Writer os) throws TransportException { | |
300 // number-of-security-types | |
301 os.writeInt(1); | |
302 // security-types | |
303 // 1:None | |
304 os.writeInt(1); | |
305 | |
306 /* | |
307 * os.write(4); os.write(30); os.write(31); os.write(32); os.write(35); | |
308 * os.flush(); | |
309 */ | |
310 } | |
311 | |
312 private void sendSecResult(Writer os) throws TransportException { | |
313 byte[] b = castIntByte(0); | |
314 os.write(b); | |
315 } | |
316 | |
317 private void readClientInit(Reader in) throws TransportException { | |
318 byte[] b = new byte[0]; | |
319 in.readBytes(b); | |
320 } | |
321 | |
85 | 322 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 | 323 private void sendInitData(Writer os) throws TransportException { |
85 | 324 // In case of "-d" we have no context |
325 if (context != null){ | |
326 os.write(context.getInitData()); | |
327 } else { | |
328 // Send dummy data | |
329 os.write(initData); | |
330 } | |
28 | 331 } |
332 | |
333 public void setProtocolContext(Protocol workingProtocol) { | |
334 context = workingProtocol; | |
335 } | |
29 | 336 |
337 | |
338 public void readSendData(int dataLen, Reader reader) throws TransportException { | |
339 | |
340 } | |
31 | 341 |
342 public Socket accept() throws IOException { | |
343 return null; | |
344 } | |
345 | |
38 | 346 public int selectPort(int port) { |
347 return port; | |
31 | 348 } |
33
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
349 |
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 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
|
352 boolean incremental) throws TransportException { |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
353 byte[] b = new byte[10]; |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
354 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
355 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
|
356 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
|
357 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
|
358 b[3] = (byte) (x & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
359 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
|
360 b[5] = (byte) (y & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
361 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
|
362 b[7] = (byte) (w & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
363 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
|
364 b[9] = (byte) (h & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
365 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
366 // os.write(b); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
367 } |
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 public void notProxy() { |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
370 proxyFlag = false; |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
371 } |
35 | 372 |
373 public void setEcho(EchoClient _echo) { | |
374 echo = _echo; | |
375 } | |
376 | |
65 | 377 public void setViewer(ViewerImpl v) { |
36 | 378 echo.setViewer(v); |
379 } | |
380 | |
65 | 381 public ViewerImpl getViewer() { |
382 return echo.getViewer(); | |
383 } | |
384 | |
35 | 385 public EchoClient getEcho() { |
386 return echo; | |
387 } | |
43 | 388 |
389 public void setTerminationType(boolean setType) { | |
390 /*nop*/ | |
391 } | |
392 | |
393 public boolean getTerminationType() { | |
394 /*nop*/ | |
395 return true; | |
396 } | |
45 | 397 |
398 public void setProxyAddr(String proxyAddr) { | |
399 this.proxyAddr = proxyAddr; | |
400 } | |
52 | 401 |
402 | |
403 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
|
404 // none |
52 | 405 } |
45 | 406 |
60 | 407 public int getAcceptPort() { |
408 return 0; | |
409 } | |
410 | |
61
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
411 public boolean getReadyReconnect() { |
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
412 return readyReconnect; |
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
413 } |
65 | 414 |
415 | |
416 public boolean getCuiVersion() { | |
417 return cuiVersion; | |
61
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
418 } |
65 | 419 |
420 public void setCuiVersion(boolean flag) { | |
421 cuiVersion = flag; | |
422 } | |
66 | 423 |
424 public void readCheckDelay(Reader reader) throws TransportException { | |
425 | |
426 } | |
427 | |
428 public String getProxyAddr() { | |
429 return proxyAddr; | |
430 } | |
65 | 431 |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
432 public synchronized void setReadyReconnect(boolean ready) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
433 readyReconnect = ready; |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
434 if (ready) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
435 notifyAll(); |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
436 } |
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 public synchronized void waitForReady(VncProxyService vncProxyService) throws InterruptedException { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
440 while (!readyReconnect) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
441 wait(); |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
442 } |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
443 } |
96 | 444 |
445 | |
446 public void sendDesktopSizeChange() { | |
447 LinkedList<ByteBuffer> desktopSize = new LinkedList<ByteBuffer>(); | |
97 | 448 int width = context.getFbWidth(); |
449 int height = context.getFbHeight(); | |
450 desktopSize.add(new UpdateRectangleMessage(0,0, width, height, EncodingType.DESKTOP_SIZE).getMessage()); | |
99 | 451 addSerialNumber(desktopSize); |
96 | 452 multicastqueue.put(desktopSize); |
453 } | |
98 | 454 |
455 | |
456 public void addSerialNumber(LinkedList<ByteBuffer> bufs) { | |
457 ByteBuffer serialNum = multicastqueue.allocate(8); | |
458 serialNum.putLong(counter++); | |
459 serialNum.flip(); | |
460 bufs.addFirst(serialNum); | |
461 } | |
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
|
462 |
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 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
|
465 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
|
466 } |
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 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
|
469 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
|
470 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
|
471 } |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
472 |
28 | 473 } |