title: Node.js TCP server throws an ECONNRESET error when a client is disconnected
body: <p>This is a very simple TCP server which is just echoing.</p>
  <pre><code>require('net').createServer(socket =&gt; socket.pipe(socket)).listen(3000);
  </code></pre>
  <p>But when I connect to it with <code>netcat</code> or a simple node client, and then press Ctrl + C to end to process, the server throws an error like this:</p>
  <pre><code>Error: read ECONNRESET
      at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
  Emitted 'error' event on Socket instance at:
      at Socket.onerror (internal/streams/readable.js:750:14)
      at Socket.emit (events.js:400:28)
      at emitErrorNT (internal/streams/destroy.js:106:8)
      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
      at processTicksAndRejections (internal/process/task_queues.js:82:21) {
    errno: -4077,
    code: 'ECONNRESET',
    syscall: 'read'
  }
  </code></pre>
  <p>I can add a listener to the socket object to handle this error. But I wanna know why such a thing causes an error? And what this error means?</p>
  <hr />
  <p>Node v14.18.1</p>
  <p>Windows 10 64-bit</p>