Catch when the user is not connected to internet

0 votes
Is possible to get the moment the user is no longer connected to internet?

Like, the game is in main menu connected, and the wifi is no longer available and i want to show a message that will say that 'you are no longer connected'.

Is there a way ?
asked Jul 20, 2014 in AppWarp by paul.bv96 (31 points)

1 Answer

+1 vote

Whenever there is a connection issue, you will get the onConnectDone callback with Connection Error result code. You can use this information to know that the connection has been broken and then you can show a dialog for no connection error on the screen.

If you are using Connection Resiliency, then you will get onConnectDone with Connection Error Recoverable, here you can call recover connection method.
answered Jul 21, 2014 by Suyash Mohan (900 points)
If i disconnect the internet onconnectdone is not called. Is called only when I try to do something like get rooms info, create room, etc.
Which SDK are you using? Also make sure you are using the latest version of SDK?

How are you disconnecting from the Internet?
The latest SDK.
My phone is connected via usb reverse tethering, I just unplug the USB cable, maybe that can be the problem?
Hi Paul - can you mention the client sdk in which you are getting this behavior i.e Windows Phone or .Net or some other platform?

The SDK works by sending keep alive messages to the server. If it doesn't receive anything in response for 6 seconds it will raise onConnectDone with 5.
I'm using it with libGDX
I have tried this scenario and am getting the event on my connection request listener.

Can you do the following after WarpClient.initialize
- WarpClient.enableTrace(true);

This will print some additional debug traces to System.out. Do share that with us.
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