Skip to content

net: multiple listen() events fail silently

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows [commit guidelines]

Affected core subsystem(s)

net

Description of change

Problem: It's possible to run listen() on a net.Server that's already listening to a port. The result is silent failure, with the side effect of changing the _connectionKey and or _pipeName.

Solution: emit error if listen method called more than once. close() method should be called between listen() method calls.

Refs: https://github.com/nodejs/node/pull/8294 Fixes: https://github.com/nodejs/node/issues/6190 Fixes: https://github.com/nodejs/node/issues/11685

Previous PR https://github.com/nodejs/node/pull/8419

Merge request reports

Loading