Although not actually used anywhere, the getSockPort method was
actually returning the the remote socket's port number.
Also simplified some of the other socket methods.
return s;
}
- //public int getMyPort() {
- // return TcpSocket.getSockPort();
- //}
+ public int getMyPort() {
+ return ((SocketDescriptor)getFd()).socket().getLocalPort();
+ }
private boolean closeFd;
private ServerSocketChannel channel;
}
public int getMyPort() {
- SocketAddress address = ((SocketDescriptor)getFd()).socket().getLocalSocketAddress();
- return ((InetSocketAddress)address).getPort();
+ return getSockPort();
}
public String getPeerAddress() {
}
public int getSockPort() {
- return ((InetSocketAddress)((SocketDescriptor)getFd()).socket().getRemoteSocketAddress()).getPort();
+ return ((SocketDescriptor)getFd()).socket().getLocalPort();
}
/* Tunnelling support. */