Poll for websocket messages until timeout expires.