Omid Aghakhani
Omid Aghakhani

Reputation: 100

Error in socket Node js

I use library net in Node JS for create socket server

All of things is good and very good working.

But it get error sometimes

Error is : events.js:163 throw er; // Unhandled 'error' event ^

Error: read ECONNRESET at exports._errnoException (util.js:1050:11) at TCP.onread (net.js:581:26)

Upvotes: 0

Views: 370

Answers (1)

Linfeng Gao
Linfeng Gao

Reputation: 76

this event triggered while the connection is dead. did you handle the server-side close event? like this

socket.on("close",function(){
 //you can't handle the network operation anymore after this by the socket object
})

the heartbeat measure is necessary in socket project.

Upvotes: 1

Related Questions