The Socket class
public Socket(String host, int port)
public Socket(InetAddress address, int port)
Getting information about a socket :
public InetAddress getInetAddress()
- Returns the address to which the socket is connected.
public int getPort()
- Returns the remote port to which this socket is connected.
public int getLocalPort()
- Returns the local port to which this socket is bound.