public SocketAddress getLocalSocketAddress ()

Returns the address of the endpoint this socket is bound to, or null if it is not bound yet.

If a socket bound to an endpoint represented by an InetSocketAddress is closed, then this method will continue to return an InetSocketAddress after the socket is closed. In that case the returned InetSocketAddress's address is the wildcard address and its port is the local port that it was bound to.

Returns:  a SocketAddress representing the local endpoint of this socket, or null if it is not bound yet.

See also:
getLocalAddress(), getLocalPort(), bind(SocketAddress)

Since:  1.4