Skip to content

net: close connection if no 'connection' listener

A net.Server without a 'connection' event listener would accept incoming connections but then proceeded to drop them into the void: the connections stay around, using up resources, but can no longer be reached by the program - i.e., they become resource leaks.

Avoid that by closing the connection when there is no listener.

It would be even better to not accept connections at all but libuv does not currently support that because It's Complicated.

Merge request reports

Loading