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 Sep 4, 2021
1 parent b47b479 commit f206af6
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 @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f206af6

Please sign in to comment.