Skip to content

Commit f206af6

Browse files
festiveelephantsealtargos
authored andcommitted
typings: add a few JSDoc typings for the net lib module
PR-URL: #38953 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent b47b479 commit f206af6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/net.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,16 @@ function isPipeName(s) {
161161
return typeof s === 'string' && toNumber(s) === false;
162162
}
163163

164+
/**
165+
* Creates a new TCP or IPC server
166+
* @param {{
167+
* allowHalfOpen?: boolean;
168+
* pauseOnConnect?: boolean;
169+
* }} [options]
170+
* @param {Function} [connectionListener]
171+
* @returns {Server}
172+
*/
173+
164174
function createServer(options, connectionListener) {
165175
return new Server(options, connectionListener);
166176
}
@@ -1563,6 +1573,11 @@ function onconnection(err, clientHandle) {
15631573
self.emit('connection', socket);
15641574
}
15651575

1576+
/**
1577+
* Gets the number of concurrent connections on the server
1578+
* @param {Function} cb
1579+
* @returns {Server}
1580+
*/
15661581

15671582
Server.prototype.getConnections = function(cb) {
15681583
const self = this;

0 commit comments

Comments
 (0)