typings: add a few JSDoc typings for the net lib module

PR-URL: https://github.com/nodejs/node/pull/38953
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
nerdthatnoonelikes
2021-06-06 12:29:37 -05:00
committed by Michaël Zasso
parent 1d638976d5
commit c4f8363bf7

View File

@@ -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;