title: Send Broadcast datagram
body: <p>I need to send a broadcast datagram to all machine (servers) connected to my network.</p>
  
  <p>I'm using NodeJS Multicast</p>
  
  <p><strong>Client</strong></p>
  
  <pre><code>var dgram = require('dgram');
  var message = new Buffer("Some bytes");
  var client = dgram.createSocket("udp4");
  client.send(message, 0, message.length, 41234, "localhost");
  // If I'm in the same machine 'localhost' works
  // I need to do something 192.168.0.255 or 255.255.255
  client.close();
  </code></pre>
  
  <p><strong>Servers</strong></p>
  
  <pre><code> var dgram = require("dgram");
  
   var server = dgram.createSocket("udp4");
  
   server.on("message", function (msg, rinfo) {
     console.log("server got: " + msg + " from " +
       rinfo.address + ":" + rinfo.port);
   });
  
   server.on("listening", function () {
     var address = server.address();
     console.log("server listening " + address.address + ":" + address.port);
   });
  
   server.bind(41234);
  </code></pre>
  
  <p>Thanks.</p>