Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closed if theres a 404 request #7

Open
galenzhao opened this issue May 11, 2016 · 5 comments
Open

closed if theres a 404 request #7

galenzhao opened this issue May 11, 2016 · 5 comments

Comments

@galenzhao
Copy link

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一下吧

@qgy18
Copy link
Owner

qgy18 commented May 11, 2016

奇怪!我刚试了一下,如果本地 web server 返回 404,通过 server 访问也会是 404,程序不会挂掉啊。

@billychow
Copy link

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

@billychow
Copy link

billychow commented Aug 23, 2016

又折腾了一下,换成了 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)

@qgy18
Copy link
Owner

qgy18 commented Aug 23, 2016

呃 是一开始就不可用,还是能用但过一会儿会挂?@billychow

@billychow
Copy link

一开始可以用,但是过一会,就会挂掉~
我刚刚对 server 端做了点修改后,进程不再直接退出了
在第93行加入了以下代码:

 sock.on('error', function(err){
   console.error(err.stack);
 });

然后观察服务端,发现是 HTTP Server 挂了,Client disconnected!然后 HTTP connection closed.了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants