From 9b7b087a2d7dcea0967f2c481577d15ac371aed4 Mon Sep 17 00:00:00 2001 From: Brian Hinz Date: Fri, 11 Nov 2011 19:12:33 +0000 Subject: [PATCH] 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 --- java/com/tigervnc/rfb/Hostname.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } } -- 2.39.5