Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
OnDisconnect not getting fired and reconnect even with bShouldAutoConnect = false; #57
Hi, I have been using this plugin for a while and is awesome, but there are two things I cant get to work:
but it doesnt work at all with OnDisconnect:
And no matter I set
Can you help me?
You need to set
As for the bound connections, have you tried the blueprint equivalent versions and confirmed that these work as expected?
Another option is to go down one level and use the FSocketIONative class which the component implements in https://github.com/getnamo/socketio-client-ue4/blob/master/Source/SocketIOClient/Private/SocketIOClientComponent.cpp#L140 to forward the events getting fired. But this is a workaround, if you have time, consider making a minimum project which allows for easy replication of the problem.
I have in my GameInstance constructor:
I have tryed setting it to false even in your USocketIOClientComponent constructor... but it keep reconnecting when the server is available again.
About the disconnected event, I have tryed it in bp too, but I only get the event when I call disconnect, not when I got disconnected, for example, closing my node.js server.
Fixed in f17df08.
The new architecture has a new callback called OnConnectionProblems. By default the plugin will attempt re-connections an infinite amount of time so OnDisconnect never gets called in the case of a server being closed. You can now detect this state by subscribing to the above function which also gives you details such as time since last connection etc etc.
The other reconnection issue should now also be fixed, re-open the issue if you find that new architecture still has this problem.