Commit Graph

6 Commits (74ef94907277d8aa29d23cef29aee25161960376)

Author SHA1 Message Date
Ben Noordhuis fb3ec32b0e net: use close callback, not process.nextTick
Don't emit the 'close' event with process.nextTick.

Closing a handle is an operation that usually *but not always* completes
on the next tick of the event loop, hence using process.nextTick is not
reliable.

Use a proper handle close callback and emit the 'close' event from
inside the callback.

Update tests that depend on the intricacies of the old model.

Fixes #3459.
2013-03-06 16:15:18 +01:00
Ben Noordhuis fa9aa1c961 net: fix 'close' event emit order
The server 'close' event was emitted before the last client 'close' event. Not
exactly fatal but potentially confusing.

Before this commit the order looked something like [client, server, client],
now it looks like [client, client, server].

See #3340 for more details.
2012-05-29 13:05:51 +02:00
Mikeal Rogers d530ee62cd Issue #2762. Add callback to close function. 2012-02-18 17:46:28 -08:00
Ryan Dahl 850609ea2d Remove separation of libuv tests 2011-11-02 16:38:59 -07:00
Ryan Dahl 4e1d6fca8e Mark tests which are broken in libuv 2011-08-23 23:45:21 -07:00
Felix Geisendörfer 09ee29318f Emit 'close' after all connections have closed
Fixes #1383
2011-07-26 11:07:17 +02:00