diff options
author | Brian Hinz <bphinz@users.sourceforge.net> | 2011-11-11 19:12:33 +0000 |
---|---|---|
committer | Brian Hinz <bphinz@users.sourceforge.net> | 2011-11-11 19:12:33 +0000 |
commit | 9b7b087a2d7dcea0967f2c481577d15ac371aed4 (patch) | |
tree | 22ed4260a7db0622925fda9b15966493ab2f321e /java/com/tigervnc/rfb/Hostname.java | |
parent | a2ebd52641e7d639732127d11d11c1b6b166e04b (diff) | |
download | tigervnc-9b7b087a2d7dcea0967f2c481577d15ac371aed4.tar.gz tigervnc-9b7b087a2d7dcea0967f2c481577d15ac371aed4.zip |
java client should accept server port specified as either rfb port or display offset. Credit to Dan Garton for pointing this out.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4796 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/com/tigervnc/rfb/Hostname.java')
-rw-r--r-- | java/com/tigervnc/rfb/Hostname.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/java/com/tigervnc/rfb/Hostname.java b/java/com/tigervnc/rfb/Hostname.java index 42fda537..3821c219 100644 --- a/java/com/tigervnc/rfb/Hostname.java +++ b/java/com/tigervnc/rfb/Hostname.java @@ -36,6 +36,9 @@ public class Hostname { if (vncServerName.charAt(colonPos+1) == ':') { return Integer.parseInt(vncServerName.substring(colonPos+2)); } - return Integer.parseInt(vncServerName.substring(colonPos+1)) + 5900; + int port = Integer.parseInt(vncServerName.substring(colonPos+1)); + if (port < 100) + port += 5900; + return port; } } |