Mercurial > hg > Members > riono > TreeVNC_ja_comment
comparison src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java @ 412:372532ae5f4d
Add ErrorAnnounce
author | innparusu |
---|---|
date | Thu, 19 Nov 2015 16:53:50 +0900 |
parents | cdab1354e227 |
children | 3af5f4af2d63 |
comparison
equal
deleted
inserted
replaced
411:4a925e55afd6 | 412:372532ae5f4d |
---|---|
303 context.setInitData(initData); | 303 context.setInitData(initData); |
304 context.setFbWidth(rect.width); | 304 context.setFbWidth(rect.width); |
305 context.setFbHeight(rect.height); | 305 context.setFbHeight(rect.height); |
306 repaintController.updateRemoteDesktopName(context); | 306 repaintController.updateRemoteDesktopName(context); |
307 reader.reset(); | 307 reader.reset(); |
308 // All children multicastqueue should be discarded hear. | 308 // All children multicastqueue should be discarded here. |
309 // rfb.clearChildrenTransmission(); | 309 // rfb.clearChildrenTransmission(); |
310 rfb.readSendData(length + 20, reader, null, rect); // size of UpdateRectangleMessage with initData. | 310 rfb.readSendData(length + 20, reader, null, rect); // size of UpdateRectangleMessage with initData. |
311 short id = (short) rect.x; | 311 short id = (short) rect.x; |
312 visible = (id != rfb.getId()); | 312 visible = (id != rfb.getId()); |
313 } | 313 } |
333 int port = rfb.acceptPort; | 333 int port = rfb.acceptPort; |
334 String address = rfb.getMyAddress(); | 334 String address = rfb.getMyAddress(); |
335 sendCheckDelayReply(rect.time, port, address); | 335 sendCheckDelayReply(rect.time, port, address); |
336 } else if (rect.getEncodingType() == EncodingType.SOUND) { | 336 } else if (rect.getEncodingType() == EncodingType.SOUND) { |
337 // SOUNDを受信した時の処理を | 337 // SOUNDを受信した時の処理を |
338 } else if (rect.getEncodingType() == EncodingType.ERROR_ANNOUNCE) { | |
339 short id = (short) rect.x; | |
340 int length = reader.readInt32(); | |
341 byte[] errorMessage = new byte[length]; | |
342 reader.read(errorMessage); | |
343 String errorMessageStr = new String(errorMessage, "UTF-8"); | |
344 if (id == rfb.getId()) { | |
345 rfb.getViewer().getConnectionPresenter().showConnectionErrorDialog(errorMessageStr); | |
346 rfb.getViewer().getConnectionPresenter().clearMessage(); | |
347 } | |
348 if (!rfb.hasParent()) { | |
349 reader.reset(); | |
350 rfb.readSendData(length + 20, reader, null, rect); | |
351 } | |
338 } else | 352 } else |
339 throw new CommonException("Unprocessed encoding: " + rect.toString()); | 353 throw new CommonException("Unprocessed encoding: " + rect.toString()); |
340 } | 354 } |
341 } catch (UnsupportedEncodingException e) { | 355 } catch (UnsupportedEncodingException e) { |
342 e.getMessage(); | 356 e.getMessage(); |