jaggedsoft/php-binance-api

ticker: WebSocket Connection closed! (1008 - Pong timeout)

mastrantonas opened this issue · 0 comments

So I am using the Trade Updates via WebSocket method of this API:

$api->trades(["BNBBTC"], function($api, $symbol, $trades) {
echo "{$symbol} trades update".PHP_EOL;
print_r($trades);
});

Then I deployed it on a Ubuntu server and let it run during the night using the nohup command on the command line.
I also wired a Telegram bot to it sending me updates on my mobile phone every 10 minutes. Noticed two times now, that after 2 hours of runtime, I got this error in the log files:

ticker: WebSocket Connection closed! (1008 - Pong timeout)

Is there a way to anticipate this, and then restart the websocket connection?