diff --git a/src/ClientImplementation.js b/src/ClientImplementation.js index 3b44d6f..b6cfc5d 100644 --- a/src/ClientImplementation.js +++ b/src/ClientImplementation.js @@ -152,6 +152,8 @@ class ClientImplementation { this.socket && (this.socket.onopen = () => null); this.socket && (this.socket.send(wireMessage.encode())); + + this.sendPinger && this.sendPinger.reset(); }; this.socket.onmessage = (event) => { @@ -418,8 +420,6 @@ class ClientImplementation { socket && socket.send(wireMessage.encode()); wireMessage.onDispatched && wireMessage.onDispatched(); } - - this.sendPinger && this.sendPinger.reset(); } /** diff --git a/src/Pinger.js b/src/Pinger.js index fb99134..423fb92 100644 --- a/src/Pinger.js +++ b/src/Pinger.js @@ -17,7 +17,6 @@ export default class { constructor(client: ClientImplementation, keepAliveIntervalSeconds: number) { this._client = client; this._keepAliveIntervalMs = keepAliveIntervalSeconds * 1000; - this.reset(); } _doPing() {