what should I do to found out the nodejs socket hang up reason

68 views Asked by At

I have a node server modified by the y-websocket https://github.com/yjs/y-websocket to recieve websocket connection, after running some times, the server will stop the connection from client and throw this error:

running at '0.0.0.0' on port 1234
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: socket hang up
    at connResetException (node:internal/errors:705:14)
    at Socket.socketOnEnd (node:_http_client:518:23)
    at Socket.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ClientRequest instance at:
    at Socket.socketOnEnd (node:_http_client:518:9)
    at Socket.emit (node:events:525:35)
    at endReadableNT (node:internal/streams/readable:1358:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'ECONNRESET'

why did this issue happen? what should I do to avoid this issue?

0

There are 0 answers