On Mon, Apr 2, 2012 at 23:35, Emerson Espínola <[email protected]> wrote: > Hi, > > I'm trying to listen for datagrams in 2 address. > > var dgram = require('dgram'); > var server = dgram.createSocket("udp4"); > server.bind(8001, "192.168.65.66"); > server.bind(8001, "192.168.33.34"); > > I'm always able to bind to the first address, but with the second I always > get error: > node.js:201 > throw e; // process.nextTick error, or 'error' event on first tick > ^ > Error: bind Unknown system errno 10038 > at errnoException (dgram.js:352:11) > at dgram.js:123:15 > at lookup (dgram.js:49:12) > at UDP.lookup4 [as lookup] (dgram.js:59:10) > at Socket.bind (dgram.js:120:16) > ... > > What am I doing wrong?
You need to create two socket objects, one for each address you want to bind to. It's kind of odd that Windows reports it as 10038 (WSAENOTSOCK). -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
