Getting Bad Request Error While Trying To Reconnect

0 votes
Hi,

I am using the AppWarpS2 Client Side SDK on Unity. In my recent game while I get Disconnected from server (getting a OnConnectDone result 5) I try to reconnect with server with WarpClient.GetInstance.Connect(username,""); But If I do so, I get a BadRequest Error (OnConnectDone 4).

So, can you guys please tell me why is it happening. I simply want to reconnect with the server if I got disconnected. And I dont want to use any connection resiliency facility.

Thanks.
closed with the note: Closing this thread as there was no update from last 2 Weeks or more. Please raise a new query if problem persists.
asked Nov 9, 2014 in AppWarpS2 by apratim.056 (28 points)
closed Aug 17, 2015 by sushil
Have you used setRecoveryAllowance() method?
Can you try to call getConnectionState method and let us know what was the connection state when you got Bad Request?
To try the connection resiliency I have set the connection recovery time to 60 sec by setConnectionRecoveryAllowance(60). The I start my game, got successfully connected to the server. To test connection resiliency, I disconnect my internet connection. Within 5-6 sec I get a onConnectDone 9 with ConnectionState 0. Then I call the recoverConnection() method. After 5-6 sec it gives me a onConnectDone 5 with ConnectionState 4. And then nothing happened although I again reconnect my internet connection within 20 sec. I think, the reason I was getting a Bad request Error cause I was again calling Connect() method while getting a onConnectDone result 5. However I think I am doing something wrong in recovering the connection process.
What version of SDK are you using? If you don't know, just tell me when did you downloaded the SDK for unity. Can you share your project with us? If possible please share you project at support@shephertz.com
After some look up I can finally recover the connection successfully. The problem was the way I was testing. However, I am facing a new problem. After the recovery allowance time passed I need to disconnect and reconnect the server. But, I found that after this time my WarpClient is still trying to recover connection (firing a recoverable connection event and the connection state is 4 i.e. recovering). So I forcefully tried to call disconnect after the recovery time but I am getting a bad request error. So my game actually freeze if the net connection is not up within the time limit. So what should i do now? I can send you a prototype my project if you want to.
I solved the Bad Request problem myself. I was calling Disconnect while a Connection recovery was in process for a little moment. Its now working fine. However, why would a recoverable connection event would raise after the recovery allowance time has passed?
Hi, Internally we are not maintaining timers for tracking the time for recovery, therefore recoverable connection error is raised every time. Anyways if you will try to recover after recovery allowance time has passed away you will receive auth error, therefore then you can know that now you have to call connect instead of recover
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
...