public boolean isConnected ()

Returns the connection state of the socket.

Note: Closing a socket doesn't clear its connection state, which means this method will return true for a closed socket (see isClosed()) if it was successfuly connected prior to being closed.

Returns:  true if the socket was successfuly connected to a server

Since:  1.4