Wait for websocket to be connected