Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* Creates a new TCP or IPC server
* @param {{
* allowHalfOpen?: boolean;
* pauseOnConnect?: boolean;
* }} options
* @param {Function} connectionListener
/**
* Creates a new TCP or IPC server
* @param {{
* allowHalfOpen?: boolean;
* pauseOnConnect?: boolean;
* }} [options]
* @param {Function} [connectionListener]

These 2 parameters are optional + formatting to keep consistency with the JSDocs in other lib modules.

* @returns {Server}
*/

function createServer(options, connectionListener) {
return new Server(options, connectionListener);
}
Expand Down Expand Up @@ -1549,6 +1559,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