Kucoin / kucoin-python-sdk

MIT License
40 stars 11 forks source link

Websocket is disconnected after aprox. 60 seconds #89

Open dpvro opened 1 year ago

dpvro commented 1 year ago

Hello everyone,

recently I have noticed that my websocket is not working anymore. It was working fine for 2 weeks and out of a sudden, is not working anymore.

I am adding all callbacks

websocket = websocket.WebSocketApp( url=websocket_link, on_open=on_open, on_message=on_message, on_error=on_error, on_close=on_close, on_ping=on_ping, on_pong=on_pong )

I am starting the websocket with the ping configuration which I got by calling the "bullet-public" endpoint:

` msg = { 'id': str(int(time.time() * 1000)), 'type': 'ping' }

           websocket.run_forever(ping_interval=pingInterval,
                                              ping_timeout=pingTimeout,
                                              ping_payload=json.dumps(msg))`

I get data for 60 seconds and after that it gets disconnected.

websocket - ERROR - Connection to remote host was lost. - goodbye

and after this error message the on_error callback is called and after that the "on_close" callback is called. For the on_error callback I get one error message: "Error: Connection to remote host was lost"

Is the handling of ping an issue or something is changed in the last days? I have tried this script of connection and getting data from websocket using other IP but same result.