What is the problem this feature will solve?
Currently, there seems no way to get all net.Server connections with the public API.
net.server.getConnections((err, count) => {...}) only returns the count of the connection, I can't get each connection within its callback. I tried for (let socket of server.connections) {...} inside the callback, and got the error TypeError: server.connections is not iterable.
I have to store each socket myself on Event: 'connection' callback, keep an array of those socket objects.
What is the feature you are proposing to solve the problem?
Inside net.server.getConnections((err, count) => {...}) callback, in addition to returning connection count, also return all the connections.
What alternatives have you considered?
No response
What is the problem this feature will solve?
Currently, there seems no way to get all
net.Serverconnections with the public API.net.server.getConnections((err, count) => {...})only returns the count of the connection, I can't get each connection within its callback. I triedfor (let socket of server.connections) {...}inside the callback, and got the error TypeError: server.connections is not iterable.I have to store each socket myself on
Event: 'connection'callback, keep an array of those socket objects.What is the feature you are proposing to solve the problem?
Inside
net.server.getConnections((err, count) => {...})callback, in addition to returning connection count, also return all the connections.What alternatives have you considered?
No response