How to handle requests/response timeouts properly

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Post Reply
User avatar
Niepodam Nigdy
Posts: 18
Joined: 08 Jan 2015, 16:47

How to handle requests/response timeouts properly

Post by Niepodam Nigdy »

When i send request from client to server and waiting for response is there a way in SmartFox to set timeout how long should client wait for response? Or should i do it myself?
And another question: is there a simple way to know in response send by server to client was delivered?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to handle requests/response timeouts properly

Post by Lapo »

There isn't a timeout mechanism, a part from the connection phase. This is usually dependent on the underlying OS TCP timeout.
There are very few reasons for using a req/resp. timeout. Not all requests get a response, some do others don't.

Also, it would be pretty difficult to set a proper timeout. Users with a slow connection may be put to a disadvantage by such mechanism and a temporary slow down on their side may cause errors that are unnecessary. The TCP already guarantees delivery and order, so it is only a matter of time.

I think it's best to let the user decide what to do. In the vast majority of cases there's no need for such thing.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply