Skip to content

Commit e62f17f

Browse files
committed
wait for two times the advertised idle interval before closing connection
1 parent 1f0d28c commit e62f17f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/connection.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ Connection.prototype.output = function () {
515515
this.heartbeat_out = setTimeout(this._write_frame.bind(this), this.remote.open.idle_time_out / 2);
516516
}
517517
if (this.local.open.idle_time_out && this.heartbeat_in === undefined) {
518-
this.heartbeat_in = setTimeout(this.idle.bind(this), this.local.open.idle_time_out);
518+
this.heartbeat_in = setTimeout(this.idle.bind(this), this.local.open.idle_time_out * 2);
519519
}
520520
}
521521
} catch (e) {
@@ -577,7 +577,7 @@ Connection.prototype.input = function (buff) {
577577
this.previous_input = previous_input;
578578
}
579579
}
580-
if (this.local.open.idle_time_out) this.heartbeat_in = setTimeout(this.idle.bind(this), this.local.open.idle_time_out);
580+
if (this.local.open.idle_time_out) this.heartbeat_in = setTimeout(this.idle.bind(this), this.local.open.idle_time_out * 2);
581581
if (this.transport.has_writes_pending()) {
582582
this.output();
583583
} else if (this.is_closed() && this.state.has_settled()) {

0 commit comments

Comments
 (0)