getnamo / SocketIOClient-Unreal

Socket.IO client plugin for the Unreal Engine.
Other
876 stars 236 forks source link

Multiple Statically Constructed SocketIOClient Components #247

Open christran opened 3 years ago

christran commented 3 years ago

1st 1 2nd 2

Is this a bug or is it not possible to have more than 1 SocketIOClient Component?

getnamo commented 3 years ago

Interesting edge case, I wonder if the timing of construction of static socketio components in non-world contexts may impact this. Looking at this branching op for non-world components https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOClient/Private/SocketIOFunctionLibrary.cpp#L24 I could potentially see that being the case. Try delaying the construction of one of your components by e.g. 0.5 sec see if that changes anything

christran commented 3 years ago

Tried delaying the construction of the 2nd component but it leads to the same problem.

Also looking at the logs it shows the first socketio component loses connection just before the second socketio component connects.

[2020.12.08-10.01.18:959][485]SocketIOLog: SocketIO Connected with session: WBCgwhARCVCh7J6EAAAA [2020.12.08-10.01.18:959][485]SocketIOLog: SocketIO WBCgwhARCVCh7J6EAAAA connected to namespace: / [2020.12.08-10.01.18:959][485]SocketIOLog: SocketIO WBCgwhARCVCh7J6EAAAA appears to have lost connection, reconnecting attempt 0 with delay 5000 [2020.12.08-10.01.25:987][506]SocketIOLog: SocketIO WBCgwhARCVCh7J6EAAAA appears to have lost connection, reconnecting attempt 1 with delay 7500 [2020.12.08-10.01.33:389][528]SocketIOLog: SocketIO Connected with session: iJFYBjZhe0a9bc_KAAAC [2020.12.08-10.01.33:389][528]SocketIOLog: SocketIO iJFYBjZhe0a9bc_KAAAC connected to namespace: /