Best practice to avoid lost socket connection

Hi everyone,
I have looked at tutorials, tried to understand example codes and searched on this forum but I didn’t find a clear list of best practices to follow to keep the connection with the Namaka server robust and efficient.

Let me explain: in all the tutorials a simple code is shown; no exception handling, no example of connection checking and reconnection attempt.

Please note that we develop for mobile devices = unstable connection.

Before inventing things that already exist, can someone please list the points of attention and a code example for a good and correct connection management with Namaka?

thanks, I hope I was clear