websocket_client class should provide a way to indicate the status of web socket as connecting, open, closing or closed. In some scenarios this is more convenient than trying some operation on websocket_client object and then catching exception for error handling.
For an example see JavaScript WebSocket implementation in IE.
For an example see JavaScript WebSocket implementation in IE.