Solved

NodeJS - { [Error: socket hang up] code: 'ECONNRESET' }

Posted on 2013-01-14
3
2,730 Views
Last Modified: 2013-02-15
Hi,

i'm getting data via http get method Node JS but i get this error often "{ [Error: socket hang up] code: 'ECONNRESET' }" error on console.

What do you think the problem?
0
Comment
Question by:ahmettiryaki
  • 2
3 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38775475
0
 

Author Comment

by:ahmettiryaki
ID: 38775502
@COBOLdinosaur in the link you posted, i couldn't find my problem. They only explain what is the mean of error.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 38775624
The problem is on the other end.  It is closing the connection.  So you probably need to look at logs on the other side to see why it is closing.

ECONNRESET means the connection has received a ReSeT (RST) segment
(ostesibly) from the remote TCP. There are a multitude of reasons
such a segment could be received, including, but not limited to:

the remote abused SO_LINGER and did an abortive close of the
connection

your application sent data which arrived after the remote called
shutdown(SHUT_RD) or close()

the remote TCP hit a retransmission limit and aborted (yes, if the
data segments weren't getting through the chances of the RST making
it are slim, but still non-zero)
*) there was some actual TCP protocol error between the two systems

9 times out of ten if the server _application_ terminates
(prematurely) the normal close() which happens on almost all platforms
will cause TCP to emit a FINished (FIN) segment. That would then be a
recv/read return of zero at your end. Of course if your application
ignored that and then tried to send something, that brings us to the
second bullet item above.

BTW it is not a rare occurrence for these kind of connects to go down frequently.

Cd&
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now