From c4f8363bf7dc4e9ee34f4bf1add2d996ad020110 Mon Sep 17 00:00:00 2001 From: nerdthatnoonelikes Date: Sun, 6 Jun 2021 12:29:37 -0500 Subject: [PATCH] typings: add a few JSDoc typings for the net lib module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/38953 Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso --- lib/net.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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;