I am trying to read streaming real time data and the websocket connection closes with the exception:
webSocketConnectionClosedException: Connection is already closed.
What could be causing it and whats the workaround?
I am trying to read streaming real time data and the websocket connection closes with the exception:
webSocketConnectionClosedException: Connection is already closed.
What could be causing it and whats the workaround?
The main reason the server would disconnect is if you send a message it doesn't understand. The exception you posted is not from the server but from your client library so it's hard to say more about the cause.
You can stream data with the CLI (quantrocket realtime stream
) to verify it works before trying to implement a connection over Python.
When I stream from CLI, with the conid and lastprice filter. It gives nothing. The exception is thrown only when it is getting the last price data. See attached.
To get streaming data, all of the following must happen:
If you're not getting data, one of those isn't happening.