-
Notifications
You must be signed in to change notification settings - Fork 230
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
4.22 Reconnection bug #126
Comments
likely a bug in https://github.com/getnamo/socket.io-client-cpp/tree/non-boost not using reliable close, to be investigated |
potential fix in 8bf27c6 |
possibly related problem: #122 |
I also have this bug. If the server disconnects unexpectedly, this client reconnects fine, however it then disconnects 5 seconds later (or whatever i set "Reconnection Delay in Ms" to) and then reconnects in a infinite loop, it's almost as if the reconnect code doesn't know there is already a connection re-established. |
Ok this doesn't happen on localhost connections, but it will appear if you use direct ip/external networking. I can now replicate this and will look into root cause. |
Temp fix: Note to self: Update: The above fixes do appear already embedded and not enough. Likely due to change to WS 0.8.1 |
Please fix it as soon as possible. Thank you very much! |
Currently my game runs on android, and the old version doesn't work |
note to self:
|
I have encountered this too. Looked at the code, i've negated IF condition on Now any connection problems are resolved. It still times out if there is connection problems, it does not reconnect every 5 secs after successful reconnection. @getnamo please take a look. I think a man who code this just did some Ctrl+C Ctrl+V mistake. |
It's a bit more complicated than that. Having a ping timeout is a good thing to detect connection problems with your server, but for some reason re-connecting doesn't seem to reset the timeout. Looking for a bit more dev time to address this properly. A temporary fix either your suggestion or commenting out https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOLib/Private/internal/sio_client_impl.cpp#L339 which will stop the timeout from closing your connection. |
I did some tests, and all timeouts were working properly. Maybe i'm not understand something? |
I think I misread your earlier comment. You do appear to be correct :) ! It does seem to fix it. It's funny how you can look at the same code often and just skim over parts with mental assumptions. I'll do some tests and merge the fix once they're done. Great spot 👍 |
fix merged into dev-unstable here: 3984f34 Will cleanup some more issues before making a new release |
Note to self: looking at past states, the above fix is still not 'proper'. Old v0.10 had the old https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOLib/Private/internal/sio_client_impl.cpp#L323 setting without the associated bug. It's likely system timer reset behaves differently from boost version. The workaround does however address the issue with minimal side effects (one alloc per ping). Should test moving reallocation to same place as ping timer and what error codes do |
Different solution posted under e2f6522. I suspect you can't cancel() and re-schedule a timer synchronously as you could in boost. I've opted to just cancel the timeout timer on the first message received after pinging https://github.com/getnamo/socketio-client-ue4/blob/e2f65228a44bfdd5dae7372049a3f283c55b6e26/Source/SocketIOLib/Private/internal/sio_client_impl.cpp#L502 which is the correct behavior. On ping interval it will re-schedule the timeout event correctly if the timeout timer has been reset, functionality remains without needing a re-allocation per message received. Tested and confirmed stability on win64. Will require tests on other platforms along with other changes for v1.1.0 release. |
Updated the early release with the fix which can be found here: https://github.com/getnamo/socketio-client-ue4/releases/tag/v1.1.0e(1.0.24) Let me know if this fix works for anyone having the problem. |
Testing this one. It does not reconnects each time for now. Tested on Win64 and Ubuntu 18.04 |
Disconnect WIFI and connect WIFI, and the SOCKET will automatically disconnect and reconnect
[2019.06.04-14.36.04:118][954]SocketIOLog: SocketIO KwYBgdagAE1scUqPAAA9 appears to have lost connection, reconnecting attempt 1 with delay 7500
[2019.06.04-14.36.04:118][954]LogTemp: OnConnectionProblems
[2019.06.04-14.36.35:849][218]SocketIOLog: SocketIO Connected with session: glZR4NHG_xAdkwMHAAA-
[2019.06.04-14.36.35:849][218]LogTemp: OnConnectedCallback
[2019.06.04-14.36.35:849][218]SocketIOLog: SocketIO glZR4NHG_xAdkwMHAAA- connected to namespace: /
[2019.06.04-14.36.35:850][218]LogTemp: OnNamespaceConnectedCallback
[2019.06.04-14.37.08:742][381]SocketIOLog: SocketIO glZR4NHG_xAdkwMHAAA- appears to have lost connection, reconnecting attempt 0 with delay 5000
[2019.06.04-14.37.08:742][381]LogTemp: OnConnectionProblems
The thread 0x66c has exited with code 0 (0x0).
[2019.06.04-14.37.29:710][545]SocketIOLog: SocketIO Connected with session: zU7SbpnESy8mwstMAAA_
[2019.06.04-14.37.29:710][545]LogTemp: OnConnectedCallback
[2019.06.04-14.37.29:710][545]SocketIOLog: SocketIO zU7SbpnESy8mwstMAAA_ connected to namespace: /
[2019.06.04-14.37.29:711][545]LogTemp: OnNamespaceConnectedCallback
The thread 0x423c has exited with code 0 (0x0).
[2019.06.04-14.38.06:849][709]SocketIOLog: SocketIO zU7SbpnESy8mwstMAAA_ appears to have lost connection, reconnecting attempt 0 with delay 5000
[2019.06.04-14.38.06:850][709]LogTemp: OnConnectionProblems
[2019.06.04-14.38.33:160][873]SocketIOLog: SocketIO Connected with session: kPvNI97Vq3apOZJGAABA
[2019.06.04-14.38.33:160][873]LogTemp: OnConnectedCallback
[2019.06.04-14.38.33:160][873]SocketIOLog: SocketIO kPvNI97Vq3apOZJGAABA connected to namespace: /
[2019.06.04-14.38.33:160][873]LogTemp: OnNamespaceConnectedCallback
[2019.06.04-14.40.52:789][ 37]SocketIOLog: SocketIO kPvNI97Vq3apOZJGAABA appears to have lost connection, reconnecting attempt 0 with delay 5000
[2019.06.04-14.40.52:789][ 37]LogTemp: OnConnectionProblems
The text was updated successfully, but these errors were encountered: