Connection bad request cause?

0 votes
My phone is connected to the internet.

First it will be connected to appwarp, if I press the back key the game will exit.

If i go again, i will get the connection error 4 (bad request)..

If I press back again, the game will connect to appwarp, back and open again, it won't.. etc

 

What can be the cause?
asked Jul 20, 2014 in AppWarp by paul.bv96 (31 points)

1 Answer

+1 vote
Hey,

Internally AppWarp Client SDK maintains a connection state which can be Connecting, Connected, Disconnected, Disconnecting and Recovering.

If AppWarp is in a state for e.g. Connected and you again call connect method you will get bad request error. So, Whenever you are switching between different pages, you should remember this. There is an API GetConnectionState() which returns the current state. WarpConnectionState contains all the connection state codes.

Also, make sure when you are exiting the application, you should call the disconnect method which will cleanly disconnect the AppWarp server
answered Jul 21, 2014 by Suyash Mohan (900 points)
I already made sure of that, on the dispose method of my game i'm removing the listeners and doing warpclient.disconnect.
So what do you think I should do to fix my problem?

Thanks for your reply!
When you call the Disconnect method, you will receive a onDisconnectDone callback, there you can check if you have successfully disconnected or not. Also check the connection state before calling connect method through GetConnectionState API.
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
...