After several hours I lost the connection to WebSocket Market Stream. I use this code:
ws_market_stream.on("ping", data => ws_market_stream.pong());
What’s wrong?
After several hours I lost the connection to WebSocket Market Stream. I use this code:
ws_market_stream.on("ping", data => ws_market_stream.pong());
What’s wrong?
There’s a number of factors that can lead to a disconnection from a websocket stream. Firstly, ensure that your network connection is stable. The websocket server will send a ping frame
every 3 minutes. If the websocket server does not receive a pong frame
back from the connection within a 10 minute period, the connection will be disconnected. A single connection is only valid for 24hrs so keep in mind that it’s normal to be disconnected and have to reconnect after 24hrs of being connected.
So you mean that if I pong the server after a ping I get disconnected however?