Mercurial > hg > Applications > TreeVNC
changeset 393:319447659dc6
Change reader process for server change in direct mode
author | innparusu |
---|---|
date | Wed, 23 Sep 2015 20:50:29 +0900 |
parents | 11e272c12092 |
children | a8610fab6861 |
files | .idea/workspace.xml src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/com/glavsoft/transport/Reader.java |
diffstat | 3 files changed, 96 insertions(+), 42 deletions(-) [+] |
line wrap: on
line diff
--- a/.idea/workspace.xml Wed Sep 23 20:32:03 2015 +0900 +++ b/.idea/workspace.xml Wed Sep 23 20:50:29 2015 +0900 @@ -2,10 +2,8 @@ <project version="4"> <component name="ChangeListManager"> <list default="true" id="0a04b9e3-21eb-43ee-b441-59e664eecd89" name="Default" comment=""> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java" afterPath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java" afterPath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettingsData.java" afterPath="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettingsData.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/glavsoft/transport/Reader.java" afterPath="$PROJECT_DIR$/src/main/java/com/glavsoft/transport/Reader.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java" afterPath="$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java" /> </list> <ignored path="TreeVNC.iws" /> <ignored path=".idea/workspace.xml" /> @@ -53,24 +51,32 @@ </provider> </entry> </file> - <file leaf-file-name="ReceiverTask.java" pinned="false" current-in-tab="false"> + <file leaf-file-name="ReceiverTask.java" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0" vertical-offset="4830" max-vertical-offset="5460"> - <caret line="344" column="20" selection-start-line="344" selection-start-column="20" selection-end-line="344" selection-end-column="20" /> + <state vertical-scroll-proportion="0.62662584" vertical-offset="1893" max-vertical-offset="8784"> + <caret line="138" column="17" selection-start-line="138" selection-start-column="17" selection-end-line="138" selection-end-column="17" /> <folding> <element signature="imports" expanded="true" /> - <element signature="e#16800#16801#0" expanded="true" /> - <element signature="e#16833#16834#0" expanded="true" /> </folding> </state> </provider> </entry> </file> - <file leaf-file-name="Surface.java" pinned="false" current-in-tab="true"> + <file leaf-file-name="Reader.java" pinned="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/src/main/java/com/glavsoft/transport/Reader.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0" vertical-offset="3823" max-vertical-offset="5238"> + <caret line="215" column="30" selection-start-line="215" selection-start-column="30" selection-end-line="215" selection-end-column="30" /> + <folding /> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="Surface.java" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.34096292" vertical-offset="2040" max-vertical-offset="5664"> + <state vertical-scroll-proportion="-9.6" vertical-offset="2088" max-vertical-offset="5664"> <caret line="139" column="54" selection-start-line="139" selection-start-column="54" selection-end-line="139" selection-end-column="54" /> <folding> <element signature="e#5826#5827#0" expanded="true" /> @@ -100,8 +106,8 @@ <state vertical-scroll-proportion="0.0" vertical-offset="315" max-vertical-offset="840"> <caret line="46" column="8" selection-start-line="46" selection-start-column="8" selection-end-line="46" selection-end-column="8" /> <folding> - <element signature="e#1938#1939#0" expanded="true" /> - <element signature="e#1959#1960#0" expanded="true" /> + <element signature="e#0#3012#0" expanded="false" /> + <element signature="imports" expanded="false" /> </folding> </state> </provider> @@ -203,7 +209,12 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="690" max-vertical-offset="1020"> <caret line="78" column="53" selection-start-line="78" selection-start-column="53" selection-end-line="78" selection-end-column="53" /> - <folding /> + <folding> + <element signature="e#0#3986#0" expanded="false" /> + <element signature="imports" expanded="false" /> + <element signature="e#2601#2602#0" expanded="false" /> + <element signature="e#2631#2632#0" expanded="false" /> + </folding> </state> </provider> </entry> @@ -213,7 +224,20 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="825" max-vertical-offset="1080"> <caret line="88" column="22" selection-start-line="88" selection-start-column="22" selection-end-line="88" selection-end-column="22" /> - <folding /> + <folding> + <element signature="e#0#2883#0" expanded="false" /> + <element signature="imports" expanded="false" /> + <element signature="e#2021#2022#0" expanded="false" /> + <element signature="e#2051#2052#0" expanded="false" /> + <element signature="e#2089#2090#0" expanded="false" /> + <element signature="e#2120#2121#0" expanded="false" /> + <element signature="e#2160#2161#0" expanded="false" /> + <element signature="e#2185#2186#0" expanded="false" /> + <element signature="e#2218#2219#0" expanded="false" /> + <element signature="e#2240#2241#0" expanded="false" /> + <element signature="e#2268#2269#0" expanded="false" /> + <element signature="e#2286#2287#0" expanded="false" /> + </folding> </state> </provider> </entry> @@ -557,12 +581,13 @@ <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeVNCNetwork.java" /> <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingRfbConnectionWorker.java" /> <option value="$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java" /> - <option value="$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java" /> <option value="$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/Protocol.java" /> <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettingsData.java" /> <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/SwingViewerWindow.java" /> <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/UiSettings.java" /> <option value="$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java" /> + <option value="$PROJECT_DIR$/src/main/java/com/glavsoft/transport/Reader.java" /> + <option value="$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java" /> </list> </option> </component> @@ -1364,13 +1389,13 @@ </line-breakpoint> <line-breakpoint type="java-line"> <url>file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java</url> - <line>156</line> + <line>163</line> <properties /> <option name="timeStamp" value="74" /> </line-breakpoint> <line-breakpoint type="java-line"> <url>file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java</url> - <line>364</line> + <line>371</line> <properties /> <option name="timeStamp" value="75" /> </line-breakpoint> @@ -1431,7 +1456,7 @@ <line-breakpoint type="java-line"> <condition disabled="true" expression="numberOfRectangles > 1" language="JAVA" custom="" /> <url>file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java</url> - <line>228</line> + <line>235</line> <properties /> <option name="timeStamp" value="105" /> </line-breakpoint> @@ -1479,7 +1504,7 @@ </line-breakpoint> <line-breakpoint type="java-line"> <url>file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java</url> - <line>227</line> + <line>234</line> <properties /> <option name="timeStamp" value="119" /> </line-breakpoint> @@ -1538,13 +1563,6 @@ <option name="FILTER_TARGETS" value="false" /> </component> <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/MulticastQueue.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.44896933" vertical-offset="0" max-vertical-offset="2641"> - <caret line="51" column="14" selection-start-line="51" selection-start-column="14" selection-end-line="51" selection-end-column="14" /> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/src/main/java/jp/ac/u_ryukyu/treevnc/SendCheckDelay.java"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="1276"> @@ -2023,6 +2041,7 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="900"> <caret line="29" column="23" selection-start-line="29" selection-start-column="23" selection-end-line="29" selection-end-column="23" /> + <folding /> </state> </provider> </entry> @@ -2229,8 +2248,8 @@ <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="810"> <caret line="46" column="8" selection-start-line="46" selection-start-column="8" selection-end-line="46" selection-end-column="8" /> <folding> - <element signature="e#1938#1939#0" expanded="true" /> - <element signature="e#1959#1960#0" expanded="true" /> + <element signature="e#0#3012#0" expanded="false" /> + <element signature="imports" expanded="false" /> </folding> </state> </provider> @@ -2239,7 +2258,12 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="278" max-vertical-offset="1632"> <caret line="78" column="53" selection-start-line="78" selection-start-column="53" selection-end-line="78" selection-end-column="53" /> - <folding /> + <folding> + <element signature="e#0#3986#0" expanded="false" /> + <element signature="imports" expanded="false" /> + <element signature="e#2601#2602#0" expanded="false" /> + <element signature="e#2631#2632#0" expanded="false" /> + </folding> </state> </provider> </entry> @@ -2255,18 +2279,19 @@ <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="721" max-vertical-offset="2016"> <caret line="88" column="22" selection-start-line="88" selection-start-column="22" selection-end-line="88" selection-end-column="22" /> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java"> - <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.0" vertical-offset="4830" max-vertical-offset="5460"> - <caret line="344" column="20" selection-start-line="344" selection-start-column="20" selection-end-line="344" selection-end-column="20" /> <folding> - <element signature="imports" expanded="true" /> - <element signature="e#16800#16801#0" expanded="true" /> - <element signature="e#16833#16834#0" expanded="true" /> + <element signature="e#0#2883#0" expanded="false" /> + <element signature="imports" expanded="false" /> + <element signature="e#2021#2022#0" expanded="false" /> + <element signature="e#2051#2052#0" expanded="false" /> + <element signature="e#2089#2090#0" expanded="false" /> + <element signature="e#2120#2121#0" expanded="false" /> + <element signature="e#2160#2161#0" expanded="false" /> + <element signature="e#2185#2186#0" expanded="false" /> + <element signature="e#2218#2219#0" expanded="false" /> + <element signature="e#2240#2241#0" expanded="false" /> + <element signature="e#2268#2269#0" expanded="false" /> + <element signature="e#2286#2287#0" expanded="false" /> </folding> </state> </provider> @@ -2384,7 +2409,7 @@ </entry> <entry file="file://$PROJECT_DIR$/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java"> <provider selected="true" editor-type-id="text-editor"> - <state vertical-scroll-proportion="0.34096292" vertical-offset="2040" max-vertical-offset="5664"> + <state vertical-scroll-proportion="-9.6" vertical-offset="2088" max-vertical-offset="5664"> <caret line="139" column="54" selection-start-line="139" selection-start-column="54" selection-end-line="139" selection-end-column="54" /> <folding> <element signature="e#5826#5827#0" expanded="true" /> @@ -2397,6 +2422,24 @@ </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/src/main/java/com/glavsoft/transport/Reader.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.0" vertical-offset="3823" max-vertical-offset="5238"> + <caret line="215" column="30" selection-start-line="215" selection-start-column="30" selection-end-line="215" selection-end-column="30" /> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java"> + <provider selected="true" editor-type-id="text-editor"> + <state vertical-scroll-proportion="0.62662584" vertical-offset="1893" max-vertical-offset="8784"> + <caret line="138" column="17" selection-start-line="138" selection-start-column="17" selection-end-line="138" selection-end-column="17" /> + <folding> + <element signature="imports" expanded="true" /> + </folding> + </state> + </provider> + </entry> </component> <component name="masterDetails"> <states>
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Wed Sep 23 20:32:03 2015 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Wed Sep 23 20:50:29 2015 +0900 @@ -123,6 +123,12 @@ isRunning = true; while (isRunning) { try { + reader.available(); + if (! isRunning) { + // server Change in direct mode + // pass the input stream to the TreeVNC protocol reader + return; + } if(! rfb.isTreeManager() && rfb.isAddSerialNum()) { // client has 8byte packet sequence number // add serial number flag (4byte) @@ -131,6 +137,7 @@ } else { reader.mark(20); } + byte messageId = reader.readByte(); switch (messageId) { case FRAMEBUFFER_UPDATE:
--- a/src/main/java/com/glavsoft/transport/Reader.java Wed Sep 23 20:32:03 2015 +0900 +++ b/src/main/java/com/glavsoft/transport/Reader.java Wed Sep 23 20:50:29 2015 +0900 @@ -211,4 +211,8 @@ throw new TransportException("Cannot skip " + length + " bytes", e); } } + + public int available() throws IOException { + return is.available(); + } }