Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 482:73b52954efc9
handling vncconnection failure
rfb/protocol/Protocol.java HG: changed src/main/java/com/glavsoft/
rfb/protocol/ReceiverTask.java HG: changed src/viewer_swing/
java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java
author | oshiro |
---|---|
date | Thu, 24 Jan 2019 17:19:05 +0900 |
parents | 6e30cb5d905f |
children | b2f734f3eaf1 |
files | src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java |
diffstat | 3 files changed, 31 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Wed Jan 23 17:57:16 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Thu Jan 24 17:19:05 2019 +0900 @@ -212,6 +212,7 @@ receiverThread = new Thread(receiverTask, "RfbReceiverTask"); receiverThread.start(); + sendRefreshMessage(); } private void correctServerPixelFormat() { @@ -280,7 +281,7 @@ public void sendRefreshMessage() { if (receiverTask!=null) { sendMessage(receiverTask.fullscreenFbUpdateIncrementalRequest); - logger.fine("sent: full FB Refresh"); + logger.fine("sent: incremental FB Refresh"); } } @@ -294,12 +295,12 @@ public synchronized void cleanUpSession() { if (senderTask != null) { // stop senderTask to VNCServer task. - senderTask.stopTask(); - try { - senderThread.join(); - } catch (InterruptedException e) { - System.out.println("any thread has interrupted the current thread"); - } + senderTask.stopTask(); + //try { + // senderThread.join(); + //} catch (InterruptedException e) { + // System.out.println("any thread has interrupted the current thread"); + //} senderTask = null; } stopReceiverTask();
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Wed Jan 23 17:57:16 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Jan 24 17:19:05 2019 +0900 @@ -153,22 +153,10 @@ System.out.println(e.getMessage()); System.out.println(e.getCause().getClass().getSimpleName()); if (e.getCause().getClass().getSimpleName().equals("SocketTimeoutException")) { - try { - if (rfb.isTreeManager()) { - sendFrameBufferUpdateRequest(); - } - reader.reset(); - } catch (TransportException e1) { - e1.printStackTrace(); - } + sendFrameBufferUpdateRequest(); continue; - } else if (e.getMessage() == "java.io.EOFException") { - try { - sendFrameBufferUpdateRequest(); - reader.reset(); - } catch (TransportException e1) { - e1.printStackTrace(); - } +// } else if (e.getMessage() == "java.io.EOFException") { +// sendFrameBufferUpdateRequest(); } logger.severe("Close session : ReceiverTask : " + e.getMessage()); if(!rfb.isTreeManager() && !(rfb.getTerminationType())) { @@ -182,6 +170,8 @@ } catch (TransportException e1) { e1.printStackTrace(); } + } else { + rfb.sendDesktopSizeChange((short) -1); } stopTask(); } catch (ProtocolException e) { @@ -209,6 +199,17 @@ } } + public void sendFrameBufferUpdateRequest() { + try { + if (rfb.isTreeManager()) { + sendFrameBufferUpdateRequest0(); + } + reader.reset(); + } catch (TransportException e1) { + e1.printStackTrace(); + } + } + private void sleep(int i) { try { Thread.sleep(i); @@ -355,9 +356,7 @@ reader.close(); } - if (rfb.isTreeManager()) { - sendFrameBufferUpdateRequest(); - } + sendFrameBufferUpdateRequest(); } private void setScreenParameter(FramebufferUpdateRectangle rect,int singleWidth ,int singleHeight) { @@ -379,7 +378,7 @@ } } - private void sendFrameBufferUpdateRequest() { + private void sendFrameBufferUpdateRequest0() { if (needSendPixelFormat) { needSendPixelFormat = false; context.setPixelFormat(pixelFormat);
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java Wed Jan 23 17:57:16 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java Thu Jan 24 17:19:05 2019 +0900 @@ -174,11 +174,11 @@ if(!myRfb.getCuiVersion()) viewerWindow = viewerWindowFactory.createViewerWindow(workingProtocol, rfbSettings, uiSettings, connectionString, presenter); workingProtocol.startNormalHandling(this,viewerWindow.getSurface(), clipboardController, myRfb); - try { - workingSocket.setSoTimeout(1000); - } catch (SocketException e) { - e.printStackTrace(); - } +// try { +// workingSocket.setSoTimeout(1000); +// } catch (SocketException e) { +// e.printStackTrace(); +// } presenter.showMessage("Started"); if(!myRfb.getCuiVersion())