Skip to content

Conversation

@gustawdaniel
Copy link

This error simply means that the other side closed the connection in a way that was probably not normal.

An example is: a socket connection can be closed by the other party abruptly due to several reasons and you will see this error / exception on your side.

In this case we need close our socket too. Before this fix I experienced the following behaviour:

  • everything works great
  • after long time this error occured, probably it can be connected with logout from gmail or network error, I do not know
  • application could detect error, but does not reset connection
  • only restart of all system allows to establish connection again

Now I want to listen in my application on connection close and end, then reset connection in my own code. I invite to discuss if it is good solution, because of I feel it is ok, but do not know how to test it.

Issue in this project

#710

Issue in dependent project

jcreigno/nodejs-mail-notifier#47

Further reading

https://www.quora.com/What-does-%E2%80%9CError-read-ECONNRESET%E2%80%9D-mean

This error simply means that the other side closed the connection in a way that was probably not normal.

An example is: a socket connection can be closed by the other party abruptly due to several reasons and you will see this error / exception on your side.

In this case we need close our socket too. Before this fix I experienced the following behaviour:
- everything works great
- after long time this error occured, probably it can be connected with logout from gmail or network error, I do not know
- application could detect error, but does not reset connection
- only restart of all system allows to establish connection again

Now I want to listen in my application on connection close and end, then reset connection in my own code. I invite to discuss if it is good solution, because of I feel it is ok, but do not know how to test it.

#710
@mscdex
Copy link
Owner

mscdex commented Mar 1, 2019

It's up to node to emit proper events on the socket (imap just bubbles those socket events up to the user), since that is where the socket is coming from. If you are not seeing 'close' emitted after 'error', then you should submit an issue to node's issue tracker as that doesn't agree with their documentation.

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

Successfully merging this pull request may close these issues.

2 participants