diff --git a/lib/net.js b/lib/net.js index 899e73f6ff167d..20601007fab695 100644 --- a/lib/net.js +++ b/lib/net.js @@ -163,6 +163,16 @@ function isPipeName(s) { return typeof s === 'string' && toNumber(s) === false; } +/** + * Creates a new TCP or IPC server + * @param {{ + * allowHalfOpen?: boolean; + * pauseOnConnect?: boolean; + * }} [options] + * @param {Function} [connectionListener] + * @returns {Server} + */ + function createServer(options, connectionListener) { return new Server(options, connectionListener); } @@ -1548,6 +1558,11 @@ function onconnection(err, clientHandle) { self.emit('connection', socket); } +/** + * Gets the number of concurrent connections on the server + * @param {Function} cb + * @returns {Server} + */ Server.prototype.getConnections = function(cb) { const self = this;