The former implementation always called ReconnectingWebsocket's ``send_pingmethod if no update message was received from kucoin for 9 seconds. If this is not the case (i.e. regular messages from kucoin) Kucoin disconnects the websocket after 1 minute because no ping was sent. ReconnectingWebsocket'srun loop then receives a connection closed error and reconnects, which means some messages until reconnection might get lost and reconnecting is also inefficient.
I changed the way send_pingis called correspondingly to assure that it is sent every 9 seconds, regardless of the amount of received message.
Coverage decreased (-0.2%) to 27.255% when pulling 1c2704044e792ea8db3fba9d97ad05d25343ea26 on MarcelBeining:master into c27a470b114d12628e18788bde14c0530182c2e5 on sammchardy:master.
The former implementation always called
ReconnectingWebsocket's ``send_ping
method if no update message was received from kucoin for 9 seconds. If this is not the case (i.e. regular messages from kucoin) Kucoin disconnects the websocket after 1 minute because no ping was sent.ReconnectingWebsocket's
run loop then receives a connection closed error and reconnects, which means some messages until reconnection might get lost and reconnecting is also inefficient. I changed the waysend_ping
is called correspondingly to assure that it is sent every 9 seconds, regardless of the amount of received message.