I'm trying to send some messages to a server. That's what I do
for(var i=0; i<100; i++){
var post={
att1 : var.att[i].att1,
att2 : var.att[i].att2,
att3 : var.att[i].att3,
att4 : var.att[i].att4
}
sock.write(JSON.stringify(post));
}
But I get this strange error
events.js:72
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at errnoException (net.js:904:11)
at Object.afterWrite (net.js:720:19)
logout
Why this happens? Is the buffer of the socket full?
events.js:72. Could you be writing after closing the socket? Perhaps something you should've waited for a callback to do?