python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

Restarting websockets connection after losing network access

Open legoly opened this issue 8 years ago • 5 comments

I occasionally lose network connectivity for a second or two and handle this exception when, say, placing an order. But once this happens, I no longer get any websockets messages. I have tried to stop/restart user and multiplex sockets with no luck. Have tried to reinitialize binance client and create new websockets connections and no new messages flow.

Is there a way to get messages flowing again once there's a network error?

legoly avatar Sep 09 '18 23:09 legoly

Have you attempted to stop the twisted reactor and then restart it?

ghost avatar Sep 11 '18 07:09 ghost

No, sorry, wouldn't even know where to look for that.

mbellmbell avatar Sep 14 '18 16:09 mbellmbell

@jmcnab57 That does not work. The reactor throws an exception saying that it can't be restarted. I have this same issue.

mfurlend avatar Mar 10 '19 19:03 mfurlend

Same problem here.. Did you find a solution for this?

matze19999 avatar May 17 '20 09:05 matze19999

Someone had any luck with this? I have the same problem. Even without network error, I can not stop and restart BinanceWebsocketManager again.

EdgarPE avatar Jan 24 '21 18:01 EdgarPE