title: using node.js to listen for udp datagrams
body: <p>I am working on a project where a C application sends udp datagrams from port 44044 and I would like to use node.js v0.10.20 to simply echo these packets to the console.</p>
  
  <p>I use the classical examples to connect:</p>
  
  <pre><code>var dgram = require('dgram');
  var port = 44044;
  
  socket = dgram.createSocket('udp4');
  
  socket.on('message', function (msg, info){
      console.log(msg.toString());
   });
  
  socket.on('listening', function(){
      var address = socket.address();
      console.log("listening on :" = address.address + ":" + address.port);
  });
  
  socket.bind(port);
  </code></pre>
  
  <p>However, when I run the example, my C application complains that the port 44044 it uses for broadcasts is already in use. Conversely, if I start my C application first, the node.js application returns immediately with an error "Error: bind EADDRINUSE".</p>
  
  <p>Now I understand that this means that I have two servers that are trying to serve on the same port. But what I don't get is how can I get a node thread that will listen to udp broadcasts on port 44044? Reading node.js documentation has not helped me solve this issue.</p>