JavaScript: connectionState

Returns the current state of the socket.