Skip to content
This repository was archived by the owner on May 15, 2020. It is now read-only.

Change listen() in DnsServer to use socket creation callback interface. #442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shabble
Copy link

@shabble shabble commented Mar 30, 2014

Per reference in
10.26 UDP docs:

Important note: the behavior of dgram.Socket#bind() has changed in v0.10 and is always asynchronous now.

The listen interface calls bind() on the underlying dns_server/Socket, and immediately invokes its own callback if provided. This has been changed to call it from inside the callback arg in the new bind(port, [adr], [cb]) format, which fixes test breakage in test_dns_server.coffee due to trying to call address too soon.

Per reference in
[10.26 UDP docs](http://nodejs.org/api/dgram.html#dgram_udp_datagram_sockets):

> Important note: the behavior of dgram.Socket#bind() has changed in v0.10 and is always asynchronous now.

The listen interface calls bind() on the underlying dns_server/Socket, and immediately invokes its own callback if provided. This has been changed to call it from inside the callback arg in the new `bind(port, [adr], [cb])` format, which fixes test breakage in `test_dns_server.coffee` due to trying to call `address` too soon.
@shabble
Copy link
Author

shabble commented Mar 30, 2014

I notice the travis build fails when tested against node 0.8, which you'd expect since the dgram bind API changed (which if I'm reading it rightly, was back in 0.9.1+, commit 332fea5ac1816e.

Does 0.8 support actually matter? I have no idea how you'd conditionally callback or not </not a node/js person>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant