nodejs-websocket
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -0,1 +1,4 @@ | ||
# 1.6.0 | ||
* Added: `Server#close` as a short hand for `Server#socket.close` | ||
# 1.5.0 | ||
@@ -2,0 +5,0 @@ * Added: `Connection#send` as a short hand for `Connection#sendText` or `Connection#sendBinary`, depending on the data type (string or Buffer) |
{ | ||
"name": "nodejs-websocket", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"author": "Sitegui <sitegui@sitegui.com.br>", | ||
@@ -24,5 +24,5 @@ "description": "Basic server&client approach to websocket (text and binary frames)", | ||
"devDependencies": { | ||
"mocha": "^2.3.4", | ||
"should": "^8.1.0" | ||
"mocha": "^2.4.5", | ||
"should": "^8.3.1" | ||
} | ||
} |
@@ -70,2 +70,5 @@ # Nodejs Websocket | ||
## server.close([callback]) | ||
Stops the server from accepting new connections and keeps existing connections. This function is asynchronous, the server is finally closed when all connections are ended and the server emits a 'close' event. The optional callback will be called once the 'close' event occurs. | ||
## server.socket | ||
@@ -72,0 +75,0 @@ The underlying socket, returned by net.createServer or tls.createServer |
@@ -100,2 +100,15 @@ /** | ||
return this | ||
} | ||
/** | ||
* Stops the server from accepting new connections and keeps existing connections. | ||
* This function is asynchronous, the server is finally closed when all connections are ended and the server emits a 'close' event. | ||
* The optional callback will be called once the 'close' event occurs. | ||
* @param {function()} [callback] | ||
*/ | ||
Server.prototype.close = function (callback) { | ||
if (callback) { | ||
this.once('close', callback) | ||
} | ||
this.socket.close() | ||
} |
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
38394
947
193