Open mattkc7 opened 5 years ago
I'm at a loss of how to edit the Bitmex websocket client code (https://github.com/BitMEX/api-connectors/blob/master/official-ws/python/bitmex_websocket.py) to have a heartbeat (https://www.bitmex.com/app/wsAPI#Heartbeats) so that i can re-establish a dropped connection.
Upon inspection of the websocket-client python code, i passed in ping_interval and ping_timeout to run_forever(), but i don't see how a connection is re-established if the current one is dropped.
ping_interval
ping_timeout
run_forever()
See https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L176-L193
and
https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L293-L303
Assuming it's the developer's responsibility to handle it, where would i fit this in?
I was tryign to figure out how to do something like:
while True: self.ws.run_forever(ping_interval=30, ping_timeout=15)
Any advice or clarification? Thanks
Did you find a solution?
I'm at a loss of how to edit the Bitmex websocket client code (https://github.com/BitMEX/api-connectors/blob/master/official-ws/python/bitmex_websocket.py) to have a heartbeat (https://www.bitmex.com/app/wsAPI#Heartbeats) so that i can re-establish a dropped connection.
Upon inspection of the websocket-client python code, i passed in
ping_interval
andping_timeout
torun_forever()
, but i don't see how a connection is re-established if the current one is dropped.See https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L176-L193
and
https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L293-L303
Assuming it's the developer's responsibility to handle it, where would i fit this in?
I was tryign to figure out how to do something like:
Any advice or clarification? Thanks