Sorry for all these best practices questions, hopefully they are of use to others as well
I’ve been trying to figure out how to handle reconnecting in between play sessions (when the game isn’t terminated). And have narrowed it down to three approaches.
- Always close the socket when the game loses focus, reconnect when it gets focus
- Let the socket connections time out (not sure when a socket closes if you dont close it manually?), when the game gets focus, test the socket and reconnect if needed.
- Always pretend the socket is working, reconnect only when it reports an error
If I can get a quick sanity check here that would be very appreciative, all the sample projects are great but none handle cases like these as far as I can tell, that are still common things mobile gamedevs deal with.
Thanks a ton!