Skip to content

Commit adb812c

Browse files
festiveelephantsealtargos
authored andcommitted
typings: add a few JSDoc typings for the net lib module
PR-URL: #38953 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 8381132 commit adb812c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: lib/net.js

+15
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@ function isPipeName(s) {
163163
return typeof s === 'string' && toNumber(s) === false;
164164
}
165165

166+
/**
167+
* Creates a new TCP or IPC server
168+
* @param {{
169+
* allowHalfOpen?: boolean;
170+
* pauseOnConnect?: boolean;
171+
* }} [options]
172+
* @param {Function} [connectionListener]
173+
* @returns {Server}
174+
*/
175+
166176
function createServer(options, connectionListener) {
167177
return new Server(options, connectionListener);
168178
}
@@ -1548,6 +1558,11 @@ function onconnection(err, clientHandle) {
15481558
self.emit('connection', socket);
15491559
}
15501560

1561+
/**
1562+
* Gets the number of concurrent connections on the server
1563+
* @param {Function} cb
1564+
* @returns {Server}
1565+
*/
15511566

15521567
Server.prototype.getConnections = function(cb) {
15531568
const self = this;

0 commit comments

Comments
 (0)