title: nodejs reconnect net connection
body: <p>I have a net client connection to a socket (using net.createConnection(port,host). this works fine. </p>
  
  <p>However, sometimes there is the possibility of the server dropping the connection, and I would like the net connection to automatically reconnect when the server is back up and running</p>
  
  <p>I can trap the on('end') event to catch the initial disconnect, and try to reconnect.  </p>
  
  <p>However,how can I check to see if the client has connected, because I want to retry every n milliseconds on a backoff strategy</p>