Sign In Register

How can we help you today?

Start a new topic
Answered

Best practices for resending a failed Request (using Unity SDK)

What is the recommended way to resend a request after it has failed (e.g. due to connection problems)?


I want to make sure that the same request is not mistakenly processed multiple times by the server, even if it is sent more than once (e.g. because the client sent it, lost connectivity before receiving an answer, but the server received it. So the client thinks the message failed, so re-sends the same request at a later time - the server should not process the request again).


It would also be good to unite several failed requests and later resend them as one request.


I can do this using custom transaction ids and such, but I want to know if there is a more straightforward and efficient way




Best Answer

Hi Baris,


The Unity SDK includes a function called setDurable which when set to true will store your requests in a queue to be sent to Gamesparks later in the event of a sudden connection drop. This will protect your game from random disconnects and allow highscores, challenges and other requests to be sent once the connection has been restored. Using this will save you having to come up with a custom solution. You can read more about it here.


Thanks,

Liam

1 Comment

Answer

Hi Baris,


The Unity SDK includes a function called setDurable which when set to true will store your requests in a queue to be sent to Gamesparks later in the event of a sudden connection drop. This will protect your game from random disconnects and allow highscores, challenges and other requests to be sent once the connection has been restored. Using this will save you having to come up with a custom solution. You can read more about it here.


Thanks,

Liam

Login to post a comment