alexkwolfe / node-eversocket

A Node.js net.Socket that automatically reconnects on close events

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not reconnect after the socket is closed twice

nevercast opened this issue · comments

I expected EverSocket to reconnect me regardless of the amount of times I was disconnected, but it seems that when destroy is called after close the first time, it removes the close listener in the _destroy handler.

Because the handler for close is removed, any future disconnections are ignored, and are not reconnected.

Thanks for reporting this issue. I'd like to get this fixed. Do you have a small sample of some code I could use to reproduce it? Even pseudocode would help.

It seems that it doesn't reconnect if the connection is error'd out.
Is this intended operation?

Thanks for the example, Josh.

There's currently nothing in EverSocket to reconnect on error, though it's just an oversight. Let me see if I can come up with a way to gracefully reconnect on error.

Thanks Alex :)

Let me know if that doesn't fix the problem for you, Josh.