tiagosiebler / binance

Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & browser support, integration tests, beautification & more.
MIT License
757 stars 266 forks source link

v2.9.2: Check ws.readyState before sending websocket pings #385

Closed dutu closed 8 months ago

dutu commented 8 months ago

Summary

WebsocketClient, before sending ping and pong, will make sure the WebSocket's readyState is OPEN. This will avoid unnecesarry errors when sending ping/pong while WebSocket is not ready (such as CONNECTING or CLOSING states).

Additional Information

Closes #384