joyent/node — pull request #3655 by tjfontaine (2012-07-06 16:08:51+00:00)
Title: defer dgram listening event

dgram `.bind`'s `._handle.lookup` may be synchronous if bind is called without an address or if address is indeed an ip. This means 'listening' may fire before a caller has assigned a handler for the event.

This patch defers that event.

However if `.bind` is called with a dns name the event may be deferred a second tick since `dns` implicitly defers requests.