Comparing version 0.10.3 to 0.10.4
@@ -317,2 +317,7 @@ /* | ||
req.sender.on('timeout', function (err) { | ||
req.emit('timeout', err) | ||
that.abort(req) | ||
}) | ||
req.sender.on('sent', function() { | ||
@@ -337,2 +342,11 @@ that._msgInFlight-- | ||
Agent.prototype.abort = function (req) { | ||
req.sender.removeAllListeners() | ||
req.sender.reset() | ||
this._cleanUp() | ||
delete this._msgIdToReq[req._packet.messageId] | ||
delete this._tkToReq[req._packet.token.readUInt32BE(0)] | ||
} | ||
function urlPropertyToPacketOption(url, req, property, option, separator) { | ||
@@ -339,0 +353,0 @@ if (url[property]) |
@@ -64,2 +64,3 @@ /* | ||
that.emit('error', err) | ||
that.emit('timeout', err) | ||
}, parameters.exchangeLifetime * 1000) | ||
@@ -66,0 +67,0 @@ } |
{ | ||
"name": "coap", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "A CoAP library for node modelled after 'http'", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -617,2 +617,16 @@ /* | ||
it('should timeout after ~247 seconds', function(done) { | ||
var req = doReq() | ||
req.on('error', function() {}) | ||
req.on('timeout', function(err) { | ||
expect(err).to.have.property('message', 'No reply in 247s') | ||
expect(err).to.have.property('retransmitTimeout', 247) | ||
done() | ||
}) | ||
fastForward(1000, 247 * 1000) | ||
}) | ||
it('should retry four times before erroring', function(done) { | ||
@@ -619,0 +633,0 @@ var req = doReq() |
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
146908
4078