Mercurial > hg > Applications > TreeVNC
annotate src/main/java/jp/ac/u_ryukyu/treevnc/MyRfbProto.java @ 112:918dc3ee1c79
send composed data.
author | oc |
---|---|
date | Fri, 23 May 2014 21:48:50 +0900 |
parents | a7988d3c0266 |
children | bce2ef0a2e79 |
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 { |
112 | 268 String adr = echo.getMyAddress(); |
269 new ScreenChangeRequest(adr).send(context.getWriter()); | |
45 | 270 } |
28 | 271 |
272 private void sendProxyFlag(Writer writer) throws TransportException { | |
273 if (proxyFlag) | |
274 writer.writeInt(1); | |
275 else | |
276 writer.writeInt(0); | |
277 } | |
278 | |
279 private void sendPortNumber(Writer writer) throws TransportException { | |
280 byte[] b = new byte[4]; | |
281 //b = castIntByte(getHost.getPort()); | |
282 b = castIntByte(9999); | |
283 writer.write(b); | |
284 } | |
285 | |
286 private byte[] castIntByte(int len) { | |
287 byte[] b = new byte[4]; | |
288 b[0] = (byte) ((len >>> 24) & 0xFF); | |
289 b[1] = (byte) ((len >>> 16) & 0xFF); | |
290 b[2] = (byte) ((len >>> 8) & 0xFF); | |
291 b[3] = (byte) ((len >>> 0) & 0xFF); | |
292 return b; | |
293 } | |
294 | |
45 | 295 |
28 | 296 private void readSecType(Reader reader) throws TransportException { |
297 byte[] b = new byte[1]; | |
298 reader.read(b); | |
299 } | |
300 | |
301 private void sendSecurityType(Writer os) throws TransportException { | |
302 // number-of-security-types | |
303 os.writeInt(1); | |
304 // security-types | |
305 // 1:None | |
306 os.writeInt(1); | |
307 | |
308 /* | |
309 * os.write(4); os.write(30); os.write(31); os.write(32); os.write(35); | |
310 * os.flush(); | |
311 */ | |
312 } | |
313 | |
314 private void sendSecResult(Writer os) throws TransportException { | |
315 byte[] b = castIntByte(0); | |
316 os.write(b); | |
317 } | |
318 | |
319 private void readClientInit(Reader in) throws TransportException { | |
320 byte[] b = new byte[0]; | |
321 in.readBytes(b); | |
322 } | |
323 | |
85 | 324 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 | 325 private void sendInitData(Writer os) throws TransportException { |
85 | 326 // In case of "-d" we have no context |
327 if (context != null){ | |
328 os.write(context.getInitData()); | |
329 } else { | |
330 // Send dummy data | |
331 os.write(initData); | |
332 } | |
28 | 333 } |
334 | |
335 public void setProtocolContext(Protocol workingProtocol) { | |
336 context = workingProtocol; | |
337 } | |
29 | 338 |
339 | |
340 public void readSendData(int dataLen, Reader reader) throws TransportException { | |
341 | |
342 } | |
31 | 343 |
344 public Socket accept() throws IOException { | |
345 return null; | |
346 } | |
347 | |
38 | 348 public int selectPort(int port) { |
349 return port; | |
31 | 350 } |
33
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 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
353 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
|
354 boolean incremental) throws TransportException { |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
355 byte[] b = new byte[10]; |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
356 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
357 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
|
358 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
|
359 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
|
360 b[3] = (byte) (x & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
361 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
|
362 b[5] = (byte) (y & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
363 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
|
364 b[7] = (byte) (w & 0xff); |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
365 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
|
366 b[9] = (byte) (h & 0xff); |
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 // os.write(b); |
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 |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
371 public void notProxy() { |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
372 proxyFlag = false; |
9d3478d11d3b
Add the processing of client
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
32
diff
changeset
|
373 } |
35 | 374 |
375 public void setEcho(EchoClient _echo) { | |
376 echo = _echo; | |
377 } | |
378 | |
65 | 379 public void setViewer(ViewerImpl v) { |
36 | 380 echo.setViewer(v); |
381 } | |
382 | |
65 | 383 public ViewerImpl getViewer() { |
384 return echo.getViewer(); | |
385 } | |
386 | |
35 | 387 public EchoClient getEcho() { |
388 return echo; | |
389 } | |
43 | 390 |
391 public void setTerminationType(boolean setType) { | |
392 /*nop*/ | |
393 } | |
394 | |
395 public boolean getTerminationType() { | |
396 /*nop*/ | |
397 return true; | |
398 } | |
45 | 399 |
400 public void setProxyAddr(String proxyAddr) { | |
401 this.proxyAddr = proxyAddr; | |
402 } | |
52 | 403 |
404 | |
405 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
|
406 // none |
52 | 407 } |
45 | 408 |
60 | 409 public int getAcceptPort() { |
410 return 0; | |
411 } | |
412 | |
61
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
413 public boolean getReadyReconnect() { |
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
414 return readyReconnect; |
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
415 } |
65 | 416 |
417 | |
418 public boolean getCuiVersion() { | |
419 return cuiVersion; | |
61
d9cf08c6415c
During implementation change screen.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents:
60
diff
changeset
|
420 } |
65 | 421 |
422 public void setCuiVersion(boolean flag) { | |
423 cuiVersion = flag; | |
424 } | |
66 | 425 |
426 public void readCheckDelay(Reader reader) throws TransportException { | |
427 | |
428 } | |
429 | |
430 public String getProxyAddr() { | |
431 return proxyAddr; | |
432 } | |
65 | 433 |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
434 public synchronized void setReadyReconnect(boolean ready) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
435 readyReconnect = ready; |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
436 if (ready) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
437 notifyAll(); |
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 |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
441 public synchronized void waitForReady(VncProxyService vncProxyService) throws InterruptedException { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
442 while (!readyReconnect) { |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
443 wait(); |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
444 } |
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
445 } |
96 | 446 |
447 | |
448 public void sendDesktopSizeChange() { | |
449 LinkedList<ByteBuffer> desktopSize = new LinkedList<ByteBuffer>(); | |
97 | 450 int width = context.getFbWidth(); |
451 int height = context.getFbHeight(); | |
452 desktopSize.add(new UpdateRectangleMessage(0,0, width, height, EncodingType.DESKTOP_SIZE).getMessage()); | |
99 | 453 addSerialNumber(desktopSize); |
96 | 454 multicastqueue.put(desktopSize); |
455 } | |
98 | 456 |
457 | |
458 public void addSerialNumber(LinkedList<ByteBuffer> bufs) { | |
459 ByteBuffer serialNum = multicastqueue.allocate(8); | |
460 serialNum.putLong(counter++); | |
461 serialNum.flip(); | |
462 bufs.addFirst(serialNum); | |
463 } | |
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
|
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 |
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 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
|
467 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
|
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 |
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 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
|
471 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
|
472 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
|
473 } |
94
75879c316796
synchronized wait for Rfb initialization in change server.
oc
parents:
89
diff
changeset
|
474 |
28 | 475 } |