SocketIOClient-Unreal icon indicating copy to clipboard operation
SocketIOClient-Unreal copied to clipboard

Somethins wrong when connect again after disconnect.

Open xiaoaq opened this issue 1 year ago • 5 comments

Steps to reproduce: connect1 - disconnect1 - connect2. Problem is , in connect2, No callback OnConnected be called, and the property bIsConnected is false.

xiaoaq avatar Sep 19 '22 06:09 xiaoaq

Is the disconnect happening on client or server side? Do you receive OnConnectionProblems callback?

getnamo avatar Sep 20 '22 00:09 getnamo

It's happened on client side, and there is not OnConnectionProblems callback received. Actually, SocketIOClient-Unreal-example can also be reproduced. 1663726596515 1663726646342 1663726686010 P1 is first time connect, P2 is disconnect and P3 is connect after disconnected.

Plugin version 1.6 & ue4.26 socket server version: 3.0+

xiaoaq avatar Sep 21 '22 02:09 xiaoaq

By the way, if I don't disconnect and connect directly again, there is no problem, it will receive the callback of OnConnected.

xiaoaq avatar Sep 21 '22 02:09 xiaoaq

Try changing Unbind Events on Disconnect toggle on your component and see if that changes the behavior for you

getnamo avatar Sep 21 '22 06:09 getnamo

Nothing seems to have changed. I see the code. SetupCallbacks will be call when the component is initialized. and ClearCallbacks will be called when disconnected. If connect again, SetupCallbacks will not be called again. Is this the cause? I call SetupCallbacks when connected, the tests showed that there was no problem, but I'm not sure whether this is the correct modification. image image

xiaoaq avatar Sep 21 '22 08:09 xiaoaq