closed if theres a 404 request
TCPServer is running at port 10000 , accept 99 http clients Client connected... HTTPServer is running at port 10001 ...
stream.js:94 throw er; // Unhandled stream error in pipe. ^ Error: read ECONNRESET at errnoException (net.js:901:11) at TCP.onread (net.js:556:19)
应该trycatch一下吧
奇怪!我刚试了一下,如果本地 web server 返回 404,通过 server 访问也会是 404,程序不会挂掉啊。
TCPServer is running at port 10000 , accept 99 http clients Client connected... HTTPServer is running at port 10001 ...
stream.js:94 throw er; // Unhandled stream error in pipe. ^ Error: read ECONNRESET at errnoException (net.js:905:11) at TCP.onread (net.js:559:19)
我这边也类似,但是不太一样的是,我是启动一段时间后,无征兆的就异常退出了。
CentOS 7, node v0.10.42
又折腾了一下,换成了 node v4.5.0,还是异常退出,但错误信息不太一样:
TCPServer is running at port 10000 , accept 99 http clients
Client connected...
HTTPServer is running at port 10001 ...
events.js:141
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:907:11)
at TCP.onread (net.js:557:26)
呃 是一开始就不可用,还是能用但过一会儿会挂?@billychow
一开始可以用,但是过一会,就会挂掉~ 我刚刚对 server 端做了点修改后,进程不再直接退出了 在第93行加入了以下代码:
sock.on('error', function(err){
console.error(err.stack);
});
然后观察服务端,发现是 HTTP Server 挂了,Client disconnected!然后 HTTP connection closed.了