admin管理员组文章数量:1424458
I just got started with nodejs and using it to create a server. Clients connect to it using socket.io, receive jobs to proceess, and send the results back to the nodejs server.
However the server will crash occassionally with the following error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: connect ECONNREFUSED
at errnoException (net.js:614:11)
at Object.afterConnect [as onplete] (net.js:605:18)
I have no idea what is causing this.
I just got started with nodejs and using it to create a server. Clients connect to it using socket.io, receive jobs to proceess, and send the results back to the nodejs server.
However the server will crash occassionally with the following error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: connect ECONNREFUSED
at errnoException (net.js:614:11)
at Object.afterConnect [as onplete] (net.js:605:18)
I have no idea what is causing this.
Share Improve this question edited Apr 29, 2012 at 12:02 Jeff LaFay 13.4k14 gold badges73 silver badges102 bronze badges asked Apr 29, 2012 at 1:17 NyxynyxNyxynyx 63.9k163 gold badges507 silver badges856 bronze badges 4- 1 Would you be able to share your source code at all? – Menztrual Commented Apr 29, 2012 at 1:46
- Where is a good place to post the source? I want to be able to take it down after a while though – Nyxynyx Commented Apr 29, 2012 at 10:33
- We mean posting blocks of code that's related to the error. Seeing that you have 1k reputation, I'm surprised you're not familiar with posting code examples. – Jeff LaFay Commented Apr 29, 2012 at 12:03
-
Sorry for my ignorance, but I am not able to tell which part of my code is causing the error.
net.js
probably came with node.js and isnt written by me... – Nyxynyx Commented Apr 29, 2012 at 12:47
2 Answers
Reset to default 3ECONNREFUSED means you tried to make a connection to another machine but your connection was refused - either no one was listening or a firewall blocked you.
I have seen this using http, but I think it could also happen using straight sockets.
You are probably struggling with node.js dying whenever the server you are calling refuses to connect. Try this:
process.on('uncaughtException', function (err) {
console.log(err);
});
It will just log the errors and keep your service up and running.
本文标签: javascriptOccassional ECONNREFUSED errorsStack Overflow
版权声明:本文标题:javascript - Occassional ECONNREFUSED errors - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745421418a2657916.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论