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

Why does readLoop() keeps getting "unexpected EOF" periodically? #76

Open
Muddz opened this issue Mar 15, 2020 · 0 comments
Open

Why does readLoop() keeps getting "unexpected EOF" periodically? #76

Muddz opened this issue Mar 15, 2020 · 0 comments

Comments

@Muddz
Copy link

Muddz commented Mar 15, 2020

I have run the Client in debug mode and put a break point here and noticed err is periodically getting unexpected EOF and thereby firing onDisconnect() everytime even when the Client has a active connection to the Server.

This will lead to unexpected behaviors, such as if anyone is trying to reconnect to the server inside onDisconnect(), which will lead to a crazy amount of TCP overflow of connections like in my case.

TCP leaks

Now one will ask why I don't let the ReconnectStrategy do the job for Reconnect, well that is because it won't reconnect if it first established a connection and then lost it, and the problem and solution for that is explained the link below.

I fixed it by avoiding setting onDisconnect() at all and by implementing this solution Feature Request: Let's implement a client.AutoReconnect() method on lost connections

Fun story: The TCP overflow of connections got entire internet of my home to crash a few times and It got me to contact my ISP provider to check for any anormalities :D

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

1 participant