how to set server timeout for client connection paused/network interrupt

0 votes
currently it happen quite fast and i want to make it longer, so my question is if any function from server side to control that timeout?
asked Apr 13, 2016 in AppWarpS2 by nguyenanhdung (51 points)

1 Answer

0 votes
Hello Dung,

Could you please provide some more description on your use case in this case? It will help us to understand the problem you are facing in better way.

Thanks.
answered Apr 13, 2016 by rajeev.etc (1,660 points)
am testing the case when mobile user press home button to back to os screen and then he come back to the game using appwarp S2. If he come back to the game quickly about 3-4 second, it will not disconnect/interrupt the connection, otherwise it will. So my concern is to not happen that fast interrrupt but set it longer.
Hi Dung,
The behavior of home button press is totally depends on the OS. For example, if you are working with iOS, when you press home button and you come back after 3-4 seconds the socket connection will be broken from the client side. To handle this situation, you can recover the session using our API recoverConnection. To use this API, you have to first tell the server that if user gets disconnected due to any interrupt then keep his session for certain time say 60 seconds. To do so, you have use setRecoveryAllowance API just after initializing AppWarp. The recommended time is 60 to 120 secs. So, if you set 60 secs as recoveryAllowance Time then in case of home button press interrupt the server will keep the user session for 60 secs. If user calls recoverConnection API within this time interval then his last session will be resumed and he can start playing from where he left. For more detail about this feature, please have look at our tutorial for Connection-Resiliency(http://appwarp.shephertz.com/game-development-center/connection-resiliency/).
Let me know if you have any further queries.
Thanks.
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
...