Comparing version 1.0.13 to 1.0.14
@@ -321,2 +321,14 @@ /* | ||
Connection.prototype.abort_socket = function (socket) { | ||
if (socket === this.socket) { | ||
log.io('[%s] aborting socket', this.options.id); | ||
this.socket.end(); | ||
this.socket.removeAllListeners('data'); | ||
this.socket.removeAllListeners('error'); | ||
this.socket.removeAllListeners('end'); | ||
this._disconnected(); | ||
} | ||
}; | ||
Connection.prototype.init = function (socket) { | ||
@@ -468,2 +480,5 @@ this.socket = socket; | ||
} | ||
if (this.local.open.idle_time_out && this.heartbeat_in === undefined) { | ||
this.heartbeat_in = setTimeout(this.idle.bind(this), this.local.open.idle_time_out); | ||
} | ||
} | ||
@@ -532,6 +547,8 @@ } catch (e) { | ||
Connection.prototype.idle = function () { | ||
if (this.is_open()) { | ||
if (!this.is_closed()) { | ||
this.abort_idle = true; | ||
this.closed_with_non_fatal_error = true; | ||
this.local.close.error = {condition:'amqp:resource-limit-exceeded', description:'max idle time exceeded'}; | ||
this.close(); | ||
setTimeout(this.abort_socket.bind(this, this.socket), 1000); | ||
} | ||
@@ -555,3 +572,6 @@ }; | ||
} | ||
if (this.heartbeat_in) clearTimeout(this.heartbeat_in); | ||
if (this.heartbeat_in) { | ||
clearTimeout(this.heartbeat_in); | ||
this.heartbeat_in = undefined; | ||
} | ||
var was_closed_with_non_fatal_error = this.closed_with_non_fatal_error; | ||
@@ -558,0 +578,0 @@ if (this.closed_with_non_fatal_error) { |
{ | ||
"name": "rhea", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "reactive AMQP 1.0 library", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/amqp/rhea", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
889908
14097