Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 486:79d614cd91c7
fix starting frame buffer update
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 26 Jan 2019 03:14:14 +0900 |
parents | 520a9a3e4975 |
children | 59cde26249b1 58c8cccacb27 |
files | .idea/compiler.xml .idea/gradle.xml .idea/misc.xml src/main/java/com/glavsoft/rfb/client/FramebufferUpdateRequestMessage.java src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/viewer_swing/java/com/glavsoft/viewer/swing/ConnectionParams.java |
diffstat | 8 files changed, 16 insertions(+), 51 deletions(-) [+] |
line wrap: on
line diff
--- a/.idea/compiler.xml Fri Jan 25 20:49:29 2019 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="CompilerConfiguration"> - <bytecodeTargetLevel> - <module name="TreeVNC_main" target="1.8" /> - <module name="TreeVNC_test" target="1.8" /> - <module name="TreeVNC_viewerSwing" target="1.8" /> - </bytecodeTargetLevel> - </component> -</project> \ No newline at end of file
--- a/.idea/gradle.xml Fri Jan 25 20:49:29 2019 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="GradleSettings"> - <option name="linkedExternalProjectsSettings"> - <GradleProjectSettings> - <option name="distributionType" value="DEFAULT_WRAPPED" /> - <option name="externalProjectPath" value="$PROJECT_DIR$" /> - <option name="gradleHome" value="/usr/local/share/gradle" /> - <option name="gradleJvm" value="1.8" /> - <option name="modules"> - <set> - <option value="$PROJECT_DIR$" /> - </set> - </option> - <option name="myModules"> - <set> - <option value="$PROJECT_DIR$" /> - </set> - </option> - </GradleProjectSettings> - </option> - </component> -</project> \ No newline at end of file
--- a/.idea/misc.xml Fri Jan 25 20:49:29 2019 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="MavenImportPreferences"> - <option name="generalSettings"> - <MavenGeneralSettings> - <option name="mavenHome" value="Bundled (Maven 3)" /> - </MavenGeneralSettings> - </option> - </component> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK"> - <output url="file://$PROJECT_DIR$/build/classes" /> - </component> -</project> \ No newline at end of file
--- a/src/main/java/com/glavsoft/rfb/client/FramebufferUpdateRequestMessage.java Fri Jan 25 20:49:29 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/client/FramebufferUpdateRequestMessage.java Sat Jan 26 03:14:14 2019 +0900 @@ -25,6 +25,8 @@ package com.glavsoft.rfb.client; import com.glavsoft.exceptions.TransportException; +import com.glavsoft.rfb.protocol.Protocol; +import com.glavsoft.rfb.protocol.ProtocolContext; import com.glavsoft.transport.Writer; import java.util.Timer; @@ -77,8 +79,11 @@ * start send full screen request timer * it is periodically executed * there is no way to stop this - */ - public void sendFullScreenRequest() { + * @param context + */ + public void sendFullScreenRequest(ProtocolContext context) { + if (! context.isRunning()) return; + context.sendRefreshMessage(); int sendFullScreenTimer = 50 * 1000; TimerTask tt = new TimerTask() { @Override
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Fri Jan 25 20:49:29 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Sat Jan 26 03:14:14 2019 +0900 @@ -213,7 +213,6 @@ receiverThread = new Thread(receiverTask, "RfbReceiverTask"); receiverThread.start(); - sendRefreshMessage(); } private void correctServerPixelFormat() { @@ -331,6 +330,11 @@ } @Override + public boolean isRunning() { + return senderTask!=null; + } + + @Override public void setTight(boolean isTight) { this.isTight = isTight; }
--- a/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Fri Jan 25 20:49:29 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Sat Jan 26 03:14:14 2019 +0900 @@ -84,6 +84,8 @@ final int MAX_RANDAM_NODE_ID = 30000; + boolean isRunning(); + /** * TreeVNC expension command (server to client) * 0 : command byte
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Jan 25 20:49:29 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Sat Jan 26 03:14:14 2019 +0900 @@ -102,7 +102,6 @@ } if(rfb.isTreeManager()) { fullscreenFbUpdateIncrementalRequest = new FramebufferUpdateRequestMessage(cp.getX(), cp.getY(), cp.getSingleWidth(), cp.getSingleHeight(), false); - fullscreenFbUpdateIncrementalRequest.sendFullScreenRequest(); connectionFinished(); } } @@ -110,6 +109,7 @@ @Override public void run() { isRunning = true; + fullscreenFbUpdateIncrementalRequest.sendFullScreenRequest(context); while (isRunning) { try { reader.available();
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/ConnectionParams.java Fri Jan 25 20:49:29 2019 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/ConnectionParams.java Sat Jan 26 03:14:14 2019 +0900 @@ -219,7 +219,7 @@ this.hostName = hostAndPort; this.portNumber = port; int i = hostAndPort.indexOf(':'); - if (i>0) { + if (i>0 && port==0) { portNumber = Integer.parseInt(hostAndPort.substring(i+1)); hostName = hostAndPort.substring(0,i); } else