Skip to content

Commit

Permalink
typings: add a few JSDoc typings for the net lib module
Browse files Browse the repository at this point in the history
PR-URL: #38953
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
festiveelephantseal authored and targos committed Jul 11, 2021
1 parent 8381132 commit adb812c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit adb812c

Please sign in to comment.