title: WADO Protocol implemented in node.js
body: <p>I am creating a very simple DICOM ECHO server with nodejs however I am facing a problem where the clients always respond as can't connect, I am unsure what I am missing, has someone here experience in writing a DICOM ECHO server?</p>
  
  <p>This is the code I have</p>
  
  <pre><code>var net = require('net');
  net.createServer(function(socket){
      socket.on('data', function(data){
          datat = String.fromCharCode.apply(null, new Uint16Array(data));
          console.log(datat);
          socket.write(data);
          socket.end()
      });
      socket.on('error', function(error){
          console.log("Caught server socket error: ")
          console.log(error.stack)
          console.log(error)
      });
  }).listen(8041);
  console.log('Server running at 127.0.0.1 on port 8041');
  </code></pre>
  
  <p>I have tried responding with the binary data and also with text data but neither one seems to work.</p>