What is basically going on in that server example when it comes to the client connecting and disconnecting? Obviously the client initiates the connection, but after that, is it the server that takes control of the connection? How long will it stay "connected" without activity? Who or what initiates the disconnect? What goes on in the refresh? It appears to be a fresh reconnect.
Can I connect at some early stage, stay connected, start the bot controls and sensing and be more efficient?