Skip to content

Commit 2587cb2

Browse files
committed
Add support for pingTimeoutDisabled option
1 parent 6a6417c commit 2587cb2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/scsocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ var SCSocket = function (opts) {
4444
// pingTimeout will be ackTimeout at the start, but it will
4545
// be updated with values provided by the 'connect' event
4646
this.pingTimeout = this.ackTimeout;
47+
this.pingTimeoutDisabled = !!opts.pingTimeoutDisabled;
4748
this.active = true;
4849

4950
this._clientMap = opts.clientMap || {};
@@ -59,7 +60,6 @@ var SCSocket = function (opts) {
5960

6061
verifyDuration('connectTimeout');
6162
verifyDuration('ackTimeout');
62-
verifyDuration('pingTimeout');
6363

6464
this._localEvents = {
6565
'connect': 1,

lib/sctransport.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var SCTransport = function (authEngine, codecEngine, options) {
3030
this.options = options;
3131
this.connectTimeout = options.connectTimeout;
3232
this.pingTimeout = options.ackTimeout;
33+
this.pingTimeoutDisabled = !!options.pingTimeoutDisabled;
3334
this.callIdGenerator = options.callIdGenerator;
3435
this.authTokenName = options.authTokenName;
3536

@@ -265,6 +266,9 @@ SCTransport.prototype._onError = function (err) {
265266
};
266267

267268
SCTransport.prototype._resetPingTimeout = function () {
269+
if (this.pingTimeoutDisabled) {
270+
return;
271+
}
268272
var self = this;
269273

270274
var now = (new Date()).getTime();

0 commit comments

Comments
 (0)