diff --git a/lib/Client.js b/lib/Client.js index 7b5979b..4551d89 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -631,11 +631,18 @@ function pingCb(self) { self._handle.ping(); } Client.prototype._ping = function() { - if (this._tmrInactive === undefined + if ((this._tmrInactive === undefined && typeof this._config.pingInactive === 'number' + && this._config.pingInactive > 0) + || (this._tmrInactive === undefined && typeof this._config.pingWaitRes === 'number' - && this._config.pingInactive > 0 - && this._config.pingWaitRes > 0) { + && this._config.pingWaitRes > 0)) { + if (this._config.pingInactive === undefined) { + this._config.pingInactive = 60000; + } + if (this._config.pingWaitRes === undefined) { + this._config.pingWaitRes = 60000; + } this._tmrInactive = setTimeout(pingCb, this._config.pingInactive, this); } };