title: How to disconnect from tcp socket in NodeJs
body: <p>I connect to socket server in NodeJs using this command:</p>
  
  <pre><code>client = net.createConnection()
  </code></pre>
  
  <p>How can I then properly disconnect from the server? </p>
  
  <p>I tried <code>client.end()</code> and even <code>client.destroy()</code></p>
  
  <p>but when I check the connection status using netstat it shows that the connection is in state FIN_WAIT2.</p>
  
  <p>How can I close and destroy the connection altogether?</p>