title: Mystery TCP error in node TLS client
body: <p>I have several node tcp clients and a tls client that connect to external servers:</p>
  
  <pre><code>    var socket = net.connect(args.connect.ip_port, args.connect.host);
      socket.setTimeout(this.timeout);
      socket.on('connect', this.socketOnConnect.bind(this));
      socket.on('error', this.socketOnError.bind(this));
      socket.on('timeout', this.socketOnTimeout.bind(this));
  </code></pre>
  
  <p>or </p>
  
  <pre><code>    this.clearStream = tls.connect(
          args.connect.ip_port,
          args.connect.url,
          {},
          this.onSecureConnect.bind(this)
      );
      this.clearStream.on('error', this.clearStreamOnError.bind(this));
      this.clearStream.on('end', this.clearStreamOnEnd.bind(this));
  </code></pre>
  
  <p>Both of these servers intermittently emit an unhandled Error:</p>
  
  <pre><code>(err): events.js:72
   (err):         throw er; // Unhandled 'error' event
   (err):               ^
   (err): Error: read ECONNRESET
   (err):     at errnoException (net.js:904:11)
   (err):     at TCP.onread (net.js:558:19)
   (err): events.js:72
   (err):         throw er; // Unhandled 'error' event
   (err):               ^
   (err): Error: read ECONNRESET
   (err):     at errnoException (net.js:904:11)
   (err):     at TCP.onread (net.js:558:19)
  </code></pre>
  
  <p>I reckoned that the on('error handler should deal with these error but evidently not.  What have I missed?</p>
  
  <p>I guess I could use a domain to wrap the connect calls but I'd rather understand what is happening before I do that.</p>