Skip to content

net: simplify server.close() behavior when closing unopened server.

I see no use case for behavior where an error is thrown in case a callback is registered for a close event on a closed server. This is bizarre and unusual.

Originally, this behavior was introduced along with commit 984dc057 in order to mimic net_legacy behavior. net_legacy for stdio was replaced by uv_net in Node 0.5.7 (2011 AD.).

Up until commit f1dc55d7, an error would be thrown synchronously if attempt has been made to close an unopen server. The change would introduce the current behavior.

This is a breaking API change and should most likely be introduced in a major update.

  • 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

Merge request reports

Loading