binance / binance-connector-node

A simple connector to Binance Public API
MIT License
553 stars 160 forks source link

When working with a stream, the "close:" callback is not called #126

Closed Blazheiko closed 1 year ago

Blazheiko commented 1 year ago

When working with a stream, the "close:" callback is not called. websocket.js. ws.on('close', (closeEventCode, reason) => { if (!wsRef.closeInitiated) { this.logger.error('Connection close due to ${closeEventCode}: ${reason}.') setTimeout(() => { this.logger.debug('Reconnect to the server.') initConnect() }, this.reconnectDelay) } else { wsRef.closeInitiated = false } })

2pd commented 1 year ago

do you receive the close message? or do you have any log?

Blazheiko commented 1 year ago

I am not getting a closing message.In the websocket.js file in the subscribe(url, callbacks) method in the corresponding "close" event handler does not trigger the callback to report the "close" event to the top

2pd commented 1 year ago

this has been fixed in the #129

Blazheiko commented 1 year ago

Thank you