mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
typings: add a few JSDoc typings for the net lib module
PR-URL: https://github.com/nodejs/node/pull/38953 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
committed by
Michaël Zasso
parent
1d638976d5
commit
c4f8363bf7
15
lib/net.js
15
lib/net.js
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user