socket.setKeepAlive(true)
hello { Error: read ECONNRESET (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read', syscall: 'read', source: 'socket' }
I see the new Socket() KeepAlive is set default true,why not read myConfig.KeepAlive .
I'm not sure what the issue is here. setKeepAlive(true) should not cause such an error in normal operation. It's used to help detect dead connections. As long as you have an 'error' event handler, that's what's important. I should also point out that sometimes this error occurs even during normal disconnection and is either the server severing the connection abruptly for whatever reason or possibly (but less likely) a bug in node.js.
yes,I know.I mean setKeepAlive(config.keepalive) .I guess long Persistent Connection is lost,But MyClinet is not know.so I want to close long Persistent Connection . yet My idea is wrong . thanks
setKeepAlive() is a TCP-level mechanism. In general you can close the connection at any time that you want.