Fix stacked heartbeats on reconnect and fix documentation

This commit is contained in:
Amish Shah
2016-10-01 20:21:28 +01:00
parent 7c26603773
commit 530035e14b
5 changed files with 3 additions and 10 deletions

View File

@@ -192,6 +192,7 @@ class WebSocketManager extends EventEmitter {
* Emitted whenever the client websocket is disconnected
* @event Client#disconnect
*/
clearInterval(this.client.manager.heartbeatInterval);
if (!this.reconnecting) this.client.emit(Constants.Events.DISCONNECT);
if (event.code === 4004) return;
if (event.code === 4010) return;