annotate src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java @ 358:59b1ef1b0a89

fix ilter single display (HiDPI)
author oc
date Tue, 03 Mar 2015 17:58:41 +0900
parents eba44a31e868
children 62a6c779fd7f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
57
17b702648079 version2.7.2 original version.
Taninari YU <you@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1 // Copyright (C) 2010, 2011, 2012, 2013 GlavSoft LLC.
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 // All rights reserved.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 //-------------------------------------------------------------------------
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // This file is part of the TightVNC software. Please visit our Web site:
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 // http://www.tightvnc.com/
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 // This program is free software; you can redistribute it and/or modify
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 // it under the terms of the GNU General Public License as published by
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 // the Free Software Foundation; either version 2 of the License, or
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 // (at your option) any later version.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 // This program is distributed in the hope that it will be useful,
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 // GNU General Public License for more details.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 // You should have received a copy of the GNU General Public License along
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 // with this program; if not, write to the Free Software Foundation, Inc.,
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 //-------------------------------------------------------------------------
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 //
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 package com.glavsoft.rfb.protocol;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 import com.glavsoft.drawing.Renderer;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 import com.glavsoft.exceptions.CommonException;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 import com.glavsoft.exceptions.ProtocolException;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 import com.glavsoft.exceptions.TransportException;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 import com.glavsoft.rfb.ClipboardController;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 import com.glavsoft.rfb.IRepaintController;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 import com.glavsoft.rfb.client.FramebufferUpdateRequestMessage;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 import com.glavsoft.rfb.client.SetPixelFormatMessage;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 import com.glavsoft.rfb.encoding.EncodingType;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 import com.glavsoft.rfb.encoding.PixelFormat;
278
69e821effec6 add comment
oc
parents: 276
diff changeset
37 import com.glavsoft.rfb.encoding.decoder.*;
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 import com.glavsoft.transport.Reader;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 import java.io.PrintWriter;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 import java.io.StringWriter;
167
1d3fa20b86bb update remoteDesktopName.
oc
parents: 166
diff changeset
42 import java.io.UnsupportedEncodingException;
255
a931be447973 add framebufferUpdateRecuest timer
oc
parents: 254
diff changeset
43 import java.util.Timer;
a931be447973 add framebufferUpdateRecuest timer
oc
parents: 254
diff changeset
44 import java.util.TimerTask;
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 import java.util.logging.Logger;
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
332
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
47 import com.glavsoft.viewer.ViewerInterface;
279
dce00f9ac98c add encodingType SEND_SINGLE_DISPLAY_WIDTH.
oc
parents: 278
diff changeset
48 import jp.ac.u_ryukyu.treevnc.*;
231
0e0e6744432c get new nodeList for checkDelay.
oc
parents: 230
diff changeset
49
35
1b81deb0abb3 write a little part reconnection.
one
parents: 28
diff changeset
50
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 public class ReceiverTask implements Runnable {
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
52 private static final byte FRAMEBUFFER_UPDATE = 0;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
53 private static final byte SET_COLOR_MAP_ENTRIES = 1;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
54 private static final byte BELL = 2;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
55 private static final byte SERVER_CUT_TEXT = 3;
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
58 private static Logger logger = Logger.getLogger("com.glavsoft.rfb.protocol.ReceiverTask");
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
59 private Reader reader;
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
60 private volatile boolean isRunning = false;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
61 private Renderer renderer;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
62 private final IRepaintController repaintController;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
63 private final ClipboardController clipboardController;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
64 protected final DecodersContainer decoders;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
65 protected FramebufferUpdateRequestMessage fullscreenFbUpdateIncrementalRequest;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
66 protected final ProtocolContext context;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
67 protected PixelFormat pixelFormat;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
68 protected boolean needSendPixelFormat;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
69 private TreeRFBProto rfb;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
70 private long checkCounter = 0;
248
e6abf4b0c92e add numberOfRectangle in checkDelay
Miwa Oshiro <e115747@ie.u-ryukyu.ac.jp>
parents: 246
diff changeset
71 public int numberOfRectangles = 0;
255
a931be447973 add framebufferUpdateRecuest timer
oc
parents: 254
diff changeset
72 private Timer timer = null;
358
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
73 private int singleWidth;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
74 private int singleHeight;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
75 private int nextWidth;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
76 private int nextHeight;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
77 private boolean isHiDPI = false;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
78 private int hiDPIWidth;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
79 private int hiDPIHeight;
255
a931be447973 add framebufferUpdateRecuest timer
oc
parents: 254
diff changeset
80
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
81 public ReceiverTask(Reader reader,
275
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
82 IRepaintController repaintController, ClipboardController clipboardController,
314
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
83 DecodersContainer decoders, final ProtocolContext context,
275
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
84 TreeRFBProto _rfb) {
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
85 rfb = _rfb;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
86 this.reader = reader;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
87 this.repaintController = repaintController;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
88 this.clipboardController = clipboardController;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
89 this.context = context;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
90 this.decoders = decoders;
178
34b7558aeffa remove TreeTask, StartTreeHandling
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 176
diff changeset
91
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
92 Decoder decoder = new ZRLEESender(rfb);
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
93 decoders.setDecoderByType(EncodingType.ZLIB, decoder);
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
94 decoders.setDecoderByType(EncodingType.ZRLE, decoder);
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
95 decoders.setDecoderByType(EncodingType.ZRLEE, decoder);
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
96
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
97 if(!rfb.getCuiVersion())
307
7e8b070dc15b create renderer filterSingleDisplay
oc
parents: 306
diff changeset
98 if (rfb.filterSingleDisplay) {
353
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
99 renderer = repaintController.createRenderer(reader, context.getFbWidth(), context.getFbHeight(), context.getPixelFormat());
307
7e8b070dc15b create renderer filterSingleDisplay
oc
parents: 306
diff changeset
100 fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, rfb.getSingleWidth(), rfb.getSingleHeight(), true);
7e8b070dc15b create renderer filterSingleDisplay
oc
parents: 306
diff changeset
101 } else {
7e8b070dc15b create renderer filterSingleDisplay
oc
parents: 306
diff changeset
102 renderer = repaintController.createRenderer(reader, context.getFbWidth(), context.getFbHeight(), context.getPixelFormat());
7e8b070dc15b create renderer filterSingleDisplay
oc
parents: 306
diff changeset
103 fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), true);
7e8b070dc15b create renderer filterSingleDisplay
oc
parents: 306
diff changeset
104 }
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
105 if(rfb.isTreeManager()) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
106 fullscreenFbUpdateIncrementalRequest.sendFullScreenRequest();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
107 connectionFinished();
314
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
108 if(rfb.checkDelay) {
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
109 SendCheckDelay sendCheckDelay = new SendCheckDelay(rfb);
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
110 Thread sendCheckDelayThread = new Thread(sendCheckDelay, "send-check-delay");
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
111 sendCheckDelayThread.start();
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
112 }
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
113 if(rfb.fixingSize) {
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
114 timer = new Timer("framebufferUpdate-request-timer", true);
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
115 timer.schedule(new TimerTask() {
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
116 @Override
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
117 public void run() {
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
118 context.setFbWidth(rfb.fixingSizeWidth);
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
119 context.setFbHeight(rfb.fixingSizeHeight);
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
120 context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), true));
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
121 }
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
122 }, 0, 100);
e95cb9a3dd9b change code, delete firstTime.
oc
parents: 307
diff changeset
123 }
358
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
124 if(rfb.filterSingleDisplay) {
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
125 singleWidth = rfb.getSingleWidth();
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
126 nextWidth = rfb.getNextWidth();
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
127 isHiDPI = rfb.setHiDPI(singleWidth, singleHeight, nextWidth);
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
128 }
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
129 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
130 }
178
34b7558aeffa remove TreeTask, StartTreeHandling
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 176
diff changeset
131
358
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
132
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
133
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
134 @Override
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
135 public void run() {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
136 isRunning = true;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
137 while (isRunning) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
138 try {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
139 if(! rfb.isTreeManager()) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
140 // client has 8byte packet sequence number
242
a640cd7001e1 fix checkdelay, and fix serial number option
oc
parents: 241
diff changeset
141 // add serial number flag (4byte)
a640cd7001e1 fix checkdelay, and fix serial number option
oc
parents: 241
diff changeset
142 reader.mark(20+8+4);
a640cd7001e1 fix checkdelay, and fix serial number option
oc
parents: 241
diff changeset
143 getLost(reader); //check seq consistency
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
144 } else {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
145 reader.mark(20);
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
146 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
147 byte messageId = reader.readByte();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
148 switch (messageId) {
275
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
149 case FRAMEBUFFER_UPDATE:
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
150 // logger.fine("Server message: FramebufferUpdate (0)");
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
151 framebufferUpdateMessage();
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
152 break;
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
153 case SET_COLOR_MAP_ENTRIES:
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
154 logger.severe("Server message SetColorMapEntries is not implemented. Skip.");
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
155 setColorMapEntries();
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
156 break;
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
157 case BELL:
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
158 logger.fine("Server message: Bell");
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
159 // System.out.print("\0007");
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
160 // System.out.flush();
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
161 break;
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
162 case SERVER_CUT_TEXT:
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
163 logger.fine("Server message: CutText (3)");
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
164 serverCutText();
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
165 break;
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
166 default:
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
167 logger.severe("Unsupported server message. Id = " + messageId);
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
168 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
169 } catch (TransportException e) {
347
1f86df6504b7 don't use clearChildrenTransmission()
Miwa Oshiro <oshiro1122@gmail.com>
parents: 345
diff changeset
170 logger.severe("Close session : ReceiverTask : " + e.getMessage());
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
171 if(!rfb.isTreeManager() && !(rfb.getTerminationType())) {
332
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
172 System.out.println("death parent node, wait connect new parent node.");
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
173 // close viewer
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
174 ViewerInterface viewer = rfb.getViewer();
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
175 viewer.setVisible(false);
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
176 try {
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
177 // clean DataInputStream
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
178 reader.close();
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
179 } catch (TransportException e1) {
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
180 e1.printStackTrace();
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
181 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
182 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
183 stopTask();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
184 } catch (ProtocolException e) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
185 logger.severe(e.getMessage());
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
186 if (isRunning) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
187 context.cleanUpSession(e.getMessage() + "\nConnection closed.");
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
188 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
189 stopTask();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
190 } catch (CommonException e) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
191 logger.severe(e.getMessage());
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
192 if (isRunning) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
193 context.cleanUpSession("Connection closed..");
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
194 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
195 stopTask();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
196 } catch (Throwable te) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
197 StringWriter sw = new StringWriter();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
198 PrintWriter pw = new PrintWriter(sw);
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
199 te.printStackTrace(pw);
353
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
200 logger.severe("updateRectangle record failed : " + te.getMessage());
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
201 if (isRunning) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
202 context.cleanUpSession(te.getMessage() + "\n" + sw.toString());
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
203 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
204 stopTask();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
205 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
206 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
207 }
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
209 private void sleep(int i) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
210 try {
145
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
211 Thread.sleep(i);
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
212 } catch (InterruptedException e) {
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
213 // nothing.
332
6a6653b67bd7 fix bug lostChild and change message panel failed connect death node
oc
parents: 331
diff changeset
214
145
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
215 }
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
216 }
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
217
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
218
649794dfb9d5 add my hostname to handle multiple network
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 135
diff changeset
219 private void setColorMapEntries() throws TransportException {
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
220 reader.readByte(); // padding
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
221 reader.readUInt16(); // first color index
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
222 int length = reader.readUInt16();
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
223 while (length-- > 0) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
224 reader.readUInt16(); // R
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
225 reader.readUInt16(); // G
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
226 reader.readUInt16(); // B
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
227 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
228 }
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
230 private void serverCutText() throws TransportException {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
231 reader.readByte(); // padding
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
232 reader.readInt16(); // padding
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
233 int length = reader.readInt32() & Integer.MAX_VALUE;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
234 clipboardController.updateSystemClipboard(reader.readBytes(length));
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
235 }
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236
353
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
237 public void framebufferUpdateMessage() throws Exception {
276
0309ea3a4f4e fix option --filterSingleDisplay, -p version.
oc
parents: 275
diff changeset
238
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
239 try {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
240 reader.readByte(); // padding
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
241 this.numberOfRectangles = reader.readUInt16();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
242 if(numberOfRectangles != 1)
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
243 System.out.println("numberofrectangle : " + numberOfRectangles);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
244 while (numberOfRectangles-- > 0) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
245 FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
246 rect.fill(reader);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
247 long time = System.currentTimeMillis();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
248 if(rfb.isTreeManager() && rfb.checkDelay)
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
249 System.out.println(time + " : size : " + rect.width * rect.height);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
250 Decoder decoder = decoders.getDecoderByType(rect.getEncodingType());
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
251 logger.finest(rect.toString() + (0 == numberOfRectangles ? "\n---" : ""));
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
252 if (decoder != null) {
353
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
253 try {
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
254 decoder.decode(reader, renderer, rect); // TreeVNC processing here
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
255 if (rfb.getCuiVersion()) continue;
358
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
256 if (rfb.filterSingleDisplay) {
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
257 if (!isHiDPI) {
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
258 if (rect.x >= rfb.getSingleWidth()) {
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
259 continue;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
260 }
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
261 } else {
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
262 if (rect.x >= rfb.getHiDPIWidth()) {
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
263 continue;
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
264 }
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
265 }
59b1ef1b0a89 fix ilter single display (HiDPI)
oc
parents: 353
diff changeset
266 }
353
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
267 repaintController.repaintBitmap(rect);
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
268 } catch (Exception e) {
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
269 throw e;
eba44a31e868 remove filterSingleDisplay option in retina version
oc
parents: 351
diff changeset
270 }
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
271 } else if (rect.getEncodingType() == EncodingType.RICH_CURSOR) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
272 RichCursorDecoder.getInstance().decode(reader, renderer, rect);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
273 if(repaintController!=null)
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
274 repaintController.repaintCursor();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
275 } else if (rect.getEncodingType() == EncodingType.CURSOR_POS) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
276 renderer.decodeCursorPosition(rect);
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
277 repaintController.repaintCursor();
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
278 } else if (rect.getEncodingType() == EncodingType.DESKTOP_SIZE || rect.getEncodingType() == EncodingType.INIT_DATA ) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
279 fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
280 rfb.setCuiVersion(false);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
281 boolean visible = true;
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
282 if (rect.getEncodingType() == EncodingType.INIT_DATA) {
345
47e351909227 add stop children sender when change server.
one@firefly.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
283 // VNCServer is changed, initiarize new screen.
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
284 int length = reader.readInt32();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
285 byte[] initData = new byte[length];
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
286 reader.read(initData);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
287 String name = new String(initData, 24, length - 24, "UTF-8");
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
288 rfb.getContext().setRemoteDesktopName(name);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
289 rfb.getContext().setInitData(initData);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
290 repaintController.updateRemoteDesktopName(rfb.getContext());
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
291 reader.reset();
345
47e351909227 add stop children sender when change server.
one@firefly.cr.ie.u-ryukyu.ac.jp
parents: 339
diff changeset
292 // All children multicastqueue should be discarded hear.
347
1f86df6504b7 don't use clearChildrenTransmission()
Miwa Oshiro <oshiro1122@gmail.com>
parents: 345
diff changeset
293 // rfb.clearChildrenTransmission();
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
294 rfb.readSendData(length + 20, reader, null, rect); // size of UpdateRectangleMessage with initData.
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
295 short id = (short) rect.x;
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
296 visible = (id != rfb.getId());
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
297 }
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
298 synchronized (renderer.getLock()) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
299 if(!(rfb.getCuiVersion()))
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
300 renderer = repaintController.createRenderer(reader, rect.width, rect.height, context.getPixelFormat());
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
301 }
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
302 if (rect.getEncodingType() == EncodingType.INIT_DATA) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
303 repaintController.setVisible(visible);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
304 }
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
305 context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false));
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
306 // repaintController.repaintCursor();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
307 } else if (rect.getEncodingType() == EncodingType.CHECK_DELAY) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
308 int checkDelaySize = 24;
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
309 reader.reset();
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
310 rfb.readSendData(checkDelaySize, reader, null, rect);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
311 int port = rfb.acceptPort;
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
312 String address = rfb.getMyAddress();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
313 sendCheckDelayReply(rect.time, port, address);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
314 } else if (rect.getEncodingType() == EncodingType.SOUND) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
315 // SOUNDを受信した時の処理を
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
316 } else
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
317 throw new CommonException("Unprocessed encoding: " + rect.toString());
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
318 }
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
319 } catch (UnsupportedEncodingException e) {
346
89c41f9870ba get singleDisplay size from retina display (HiDPI).
oc
parents: 345
diff changeset
320 e.getMessage();
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
321 e.printStackTrace();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
322 reader.close();
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
323 }
275
0f9b3de45fb2 set main display size.
oc
parents: 272
diff changeset
324
336
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
325 if (rfb.isTreeManager()) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
326 synchronized (this) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
327 if (needSendPixelFormat) {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
328 needSendPixelFormat = false;
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
329 context.setPixelFormat(pixelFormat);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
330 context.sendMessage(new SetPixelFormatMessage(pixelFormat));
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
331 logger.fine("sent: " + pixelFormat);
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
332 context.sendRefreshMessage();
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
333 logger.fine("sent: nonincremental fb update");
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
334 } else {
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
335 context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, context.getFbWidth(), context.getFbHeight(), false));
2aa4fcbc5ba2 fix framebufferUpdate
oc
parents: 332
diff changeset
336 }
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
337 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
338 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
339 }
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340
234
8479ad028ec7 fix checkdelay send and get.
oc
parents: 233
diff changeset
341 private void sendCheckDelayReply(long time, int port, String address) throws UnsupportedEncodingException {
8479ad028ec7 fix checkdelay send and get.
oc
parents: 233
diff changeset
342 context.sendMessage(new CheckDelayReply(time, port, address));
230
f4ea9ff04741 reply checkdelay
oc
parents: 229
diff changeset
343 }
f4ea9ff04741 reply checkdelay
oc
parents: 229
diff changeset
344
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
345 public synchronized void queueUpdatePixelFormat(PixelFormat pf) {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
346 pixelFormat = pf;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
347 needSendPixelFormat = true;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
348 // context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, 1, 1, false));
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
349 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
350
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
351 public void stopTask() {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
352 isRunning = false;
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
353 }
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
355 private void connectionFinished() {
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
356 rfb.vncConnected(true);
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
357 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
358
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
359 private void getLost(Reader reader) throws Exception {
242
a640cd7001e1 fix checkdelay, and fix serial number option
oc
parents: 241
diff changeset
360 int addSerialNumFlag = reader.readInt32();
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
361 long num = reader.readInt64();
243
0ed7719c1800 fix serial number option.
oc
parents: 242
diff changeset
362 if (addSerialNumFlag == 1) {
0ed7719c1800 fix serial number option.
oc
parents: 242
diff changeset
363 rfb.setAddSerialNum(true);
0ed7719c1800 fix serial number option.
oc
parents: 242
diff changeset
364 if(num != ++checkCounter) {
0ed7719c1800 fix serial number option.
oc
parents: 242
diff changeset
365 System.out.println("LostData" + (num - checkCounter));
0ed7719c1800 fix serial number option.
oc
parents: 242
diff changeset
366 checkCounter = num;
0ed7719c1800 fix serial number option.
oc
parents: 242
diff changeset
367 }
224
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
368 }
ccbc3a951961 fix indent, update mm.
oc
parents: 215
diff changeset
369 }
0
4689cc86d6cb create TreeViewer2 Repository
Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 }