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 authored and Michaël Zasso committed 2021-09-04 13:05:00 +02:00
1 parent b47b47930c
commit f206af679c
1 file changed
+15
+15
View File
@@ -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;