From f206af679c2292aecab048f2f4bbeca2e8f91539 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 b1e5dbf2f26a28..cacce2a2ee99cb 100644 --- a/lib/net.js +++ b/lib/net.js @@ -161,6 +161,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); } @@ -1563,6 +1573,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;