aboutsummaryrefslogtreecommitdiffstats
path: root/java/com/tigervnc/rfb/Hostname.java
diff options
context:
space:
mode:
authorBrian Hinz <bphinz@users.sourceforge.net>2011-11-11 19:12:33 +0000
committerBrian Hinz <bphinz@users.sourceforge.net>2011-11-11 19:12:33 +0000
commit9b7b087a2d7dcea0967f2c481577d15ac371aed4 (patch)
tree22ed4260a7db0622925fda9b15966493ab2f321e /java/com/tigervnc/rfb/Hostname.java
parenta2ebd52641e7d639732127d11d11c1b6b166e04b (diff)
downloadtigervnc-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.java5
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;
}
}