Mercurial > hg > Applications > TreeVNC
comparison src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java @ 414:3af5f4af2d63
Send data size for checkDelay
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Nov 2015 02:18:51 +0900 |
parents | 372532ae5f4d |
children | 5c3635d6ab3c |
comparison
equal
deleted
inserted
replaced
413:1228677ca888 | 414:3af5f4af2d63 |
---|---|
133 // client has 8byte packet sequence number | 133 // client has 8byte packet sequence number |
134 // add serial number flag (4byte) | 134 // add serial number flag (4byte) |
135 reader.mark(20+8+4); | 135 reader.mark(20+8+4); |
136 getLost(reader); //check seq consistency | 136 getLost(reader); //check seq consistency |
137 } else { | 137 } else { |
138 reader.mark(20); | 138 reader.mark(20+8); |
139 } | 139 } |
140 | 140 |
141 byte messageId = reader.readByte(); | 141 byte messageId = reader.readByte(); |
142 switch (messageId) { | 142 switch (messageId) { |
143 case FRAMEBUFFER_UPDATE: | 143 case FRAMEBUFFER_UPDATE: |
326 context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false)); | 326 context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false)); |
327 } | 327 } |
328 | 328 |
329 } else if (rect.getEncodingType() == EncodingType.CHECK_DELAY) { | 329 } else if (rect.getEncodingType() == EncodingType.CHECK_DELAY) { |
330 int checkDelaySize = 24; | 330 int checkDelaySize = 24; |
331 reader.reset(); | |
332 rfb.readSendData(checkDelaySize, reader, null, rect); | |
333 int port = rfb.acceptPort; | 331 int port = rfb.acceptPort; |
334 String address = rfb.getMyAddress(); | 332 String address = rfb.getMyAddress(); |
335 sendCheckDelayReply(rect.time, port, address); | 333 int dataLen = reader.readInt32(); |
334 sendCheckDelayReply(rect.time, port, address, dataLen); | |
335 reader.reset(); | |
336 reader.readBytes(24); | |
337 decoder = decoders.getDecoderByType(EncodingType.ZRLEE); | |
338 decoder.decode(reader, renderer, rect); // TreeVNC processing here | |
336 } else if (rect.getEncodingType() == EncodingType.SOUND) { | 339 } else if (rect.getEncodingType() == EncodingType.SOUND) { |
337 // SOUNDを受信した時の処理を | 340 // SOUNDを受信した時の処理を |
338 } else if (rect.getEncodingType() == EncodingType.ERROR_ANNOUNCE) { | 341 } else if (rect.getEncodingType() == EncodingType.ERROR_ANNOUNCE) { |
339 short id = (short) rect.x; | 342 short id = (short) rect.x; |
340 int length = reader.readInt32(); | 343 int length = reader.readInt32(); |
372 } | 375 } |
373 } | 376 } |
374 } | 377 } |
375 } | 378 } |
376 | 379 |
377 private void sendCheckDelayReply(long time, int port, String address) throws UnsupportedEncodingException { | 380 private void sendCheckDelayReply(long time, int port, String address, int dataLen) throws UnsupportedEncodingException { |
378 context.sendMessage(new CheckDelayReply(time, port, address)); | 381 context.sendMessage(new CheckDelayReply(time, port, address, dataLen)); |
379 } | 382 } |
380 | 383 |
381 public synchronized void queueUpdatePixelFormat(PixelFormat pf) { | 384 public synchronized void queueUpdatePixelFormat(PixelFormat pf) { |
382 pixelFormat = pf; | 385 pixelFormat = pf; |
383 needSendPixelFormat = true; | 386 needSendPixelFormat = true; |