Disconnection and unable to reconnect! Corona SDK

0 votes

I have been working on a realtime multiplayer game in Corona SDK.

The user logs in, everything works fine, but then after 2-10 minutes it says connection error 9, which is supposed to mean that the connection is recoverable. So I call recoverConnection(), and it is a hit or miss; sometimes it works, other times it doesn't and gives a 9 or 1 error again. I have it set up so that everytime it gets a connection error it tries to connect over and over.

I set the recovery allowance to 100.

I don't know what is causing it to disconnect. I'm connected to wifi on my desk, so i'm not moving around. I don't get how it can't reconnect sometimes!

This is very frustrating!

Please HELP!
asked Aug 9, 2014 in AppWarp by chasemorell (10 points)

1 Answer

0 votes

To verify the internet connectivity, Client sends keep-Alive messages every 2 seconds and if continous 3 attempts are failed, client gets CONNECTION_ERROR_RECOVERABLE  ie 9 in onConnectDone() callback.

Please make sure that you are calling recoverConnection() with in the time limit which you have specified in setRecoveryAllowance(), otherwise you will get AUTH_ERROR ie 1. Because server removes the user session after the recovery allowance time is over.
answered Aug 10, 2014 by NaveenGShephertz (244 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com