public InetSocketAddress getRemoteAddressTCP ( ) { SocketChannel socketChannel = tcp . socketChannel ; if ( socketChannel != null ) { Socket socket = tcp . socketChannel . socket ( ) ; if ( socket != null ) { return ( InetSocketAddress ) socket . getRemoteSocketAddress ( ) ; } } return null ; }
Returns the IP address and port of the remote end of the TCP connection or null if this connection is not connected .