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

Unconnected socket cannot be stopped (unless disposed) #63

Closed
jeffrson opened this issue May 24, 2023 · 2 comments
Closed

Unconnected socket cannot be stopped (unless disposed) #63

jeffrson opened this issue May 24, 2023 · 2 comments

Comments

@jeffrson
Copy link

An unconnected socket (destination unavailable) keeps trying to reconnect, even if .Disconnect(Async) had been called.
So it would connect as soon as the destination is available, which it shouldn't because of .Disconnect.

Such it is hard to "pause" a connection without destroying it completely (.Dispose).

Reason is, that .Disconnect only ever does something when the Connected property is true.

@itisnajim
Copy link
Owner

itisnajim commented May 26, 2023

https://github.com/doghappy/socket.io-client-csharp#options
set Reconnectionto false

2nd time I answer you from the Readme,
see https://github.com/doghappy/socket.io-client-csharp and https://github.com/itisnajim/SocketIOUnity
good luck

@jeffrson
Copy link
Author

jeffrson commented May 27, 2023

Well, while I could admit that I had not paid enough attention to "Check the 'Samples~' folder and socket.io-client-csharp repo for more usage info." for the first issue (which is still not obvious to me though, because of "Supports socket.io server v2/v3/v4"), this one is absolutely different.

I don't want to set Reconnection to false - I just don't want it to reconnect after I called Disconnect. Is there any way to change Reconnection after new SocketIO? Cannot find it in the Readme.

Also, it does not make much sense that it behaves differently if one calls Disconnect while it is connected or not. In the first case it does not try to reconnect, in the second it does. I think this is already understandable from the first post in this issue.

Therefore this issue should be reopened because it's fairly valid.

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

2 participants