title: Node.js : Communication between two servers (net)
body: <p>I need help about the communication between two servers using 'net' library.
  I have two servers process : a master and a slave. The goal is : when the master server down, the slave get up and continue the job.</p>
  
  <p>Well, this is my code :</p>
  
  <pre><code>    // MASTER
      var server = net.createServer(function (conn) {
          conn.on("error", function() {
          });
      });
      server.listen(61337, "localhost", function () {});
  
      // SLAVE
      var socket = new net.Socket();
      socket.connect(61337, "localhost", function () {
      });
      socket.on('error', function (exc) {
          if((""+exc) == "Error: read ECONNRESET") {
              console.log("ALERT : MASTER is down !");
          }
      });
  </code></pre>
  
  <p>How can i do to send a message MASTER -> SLAVE ?</p>
  
  <p>Thanks.</p>