code: function TcpStreamError (err) {
          this.simulator.Debug (3,"TcpStream [%s:%s] connection err=%s", this.simulator.opts.host, this.simulator.opts.port, err);
          delete ActiveClients[this];
          setTimeout (function(){ // wait for timeout and recreate a new Object from scratch
              simulator.TcpClient ();
          }, this.timeout);
      }
docs: Remote server close connection