amqp10-transport-ws
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -27,5 +27,12 @@ 'use strict'; | ||
this._socket.on('connect', function () { self.emit('connect'); }); | ||
this._socket.on('error', function (err) { self.emit('error', err); }); | ||
this._socket.on('error', function (err) { | ||
self.hasError = true; | ||
self.emit('error', err); | ||
}); | ||
this._socket.on('text', function (text) { self.emit('data', text); }); | ||
this._socket.on('close', function (code, reason) { self.emit('end', code + ": " + reason); }); | ||
this._socket.on('close', function (code, reason) { | ||
process.nextTick(function() { | ||
self.emit('end', code + ": " + reason); | ||
}); | ||
}); | ||
@@ -60,6 +67,7 @@ this._socket.on('binary', function (inStream) { | ||
if (this._socket.readyState !== this._socket.CLOSED) { | ||
this._socket.removeAllListeners(); | ||
if (this._socket.readyState !== this._socket.CLOSED && !this.hasError) { | ||
this._socket.close(); | ||
} | ||
this._socket.removeAllListeners(); | ||
}; | ||
@@ -66,0 +74,0 @@ |
{ | ||
"name": "amqp10-transport-ws", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Provides a Websocket implementation for the transport layer for node-amqp10.", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7945
62
0