title: node.js - share sockets between processes
body: <p>I´ve read that it´s possible to share sockets between processes. Is this also possible in Node.js?</p>
  
  <p>I saw the cluster api in node.js, but that´s not what I´m looking for. I want to be able to accept a connection in one process, maybe send &amp; read a bit, and after a while pass this socket to another fully independent node.js process.</p>
  
  <p>I could already do this with piping, but I don´t want to do this, since it´s not as fast as directly reading/writing to the socket itself.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Update</strong>
  I found the following entry in the node.js documentation:</p>
  
  <pre><code>new net.Socket([options]) #
  Construct a new socket object.
  
  options is an object with the following defaults:
  
  { fd: null
    type: null
    allowHalfOpen: false
  }
  fd allows you to specify the existing file descriptor of socket. type specified underlying protocol. It can be 'tcp4', 'tcp6', or 'unix'. About allowHalfOpen, refer to createServer() and 'end' event.
  </code></pre>
  
  <p>I think it would be possible to set the "fd" property to the filedescriptor of the socket  and then open the socket with that. But... How can I get the filedescriptor of the socket and pass it to the process that needs it?</p>
  
  <p>Thanks for any help!</p>