diff options
Diffstat (limited to 'java/com/tigervnc/network/TcpSocket.java')
-rw-r--r-- | java/com/tigervnc/network/TcpSocket.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/java/com/tigervnc/network/TcpSocket.java b/java/com/tigervnc/network/TcpSocket.java index 051a9d82..43787e4d 100644 --- a/java/com/tigervnc/network/TcpSocket.java +++ b/java/com/tigervnc/network/TcpSocket.java @@ -113,8 +113,7 @@ public class TcpSocket extends Socket { } public int getMyPort() { - SocketAddress address = ((SocketDescriptor)getFd()).socket().getLocalSocketAddress(); - return ((InetSocketAddress)address).getPort(); + return getSockPort(); } public String getPeerAddress() { @@ -184,7 +183,7 @@ public class TcpSocket extends Socket { } public int getSockPort() { - return ((InetSocketAddress)((SocketDescriptor)getFd()).socket().getRemoteSocketAddress()).getPort(); + return ((SocketDescriptor)getFd()).socket().getLocalPort(); } /* Tunnelling support. */ |