Sign In Register

How can we help you today?

Start a new topic
Answered

SetDurable is causing a timeout

I'm using the SetDurable option on a custom event request, but once internet connectivity is regained in my testing, I am given a timeout error on the request.


I have set SetMaxQueueTimeInSeconds and SetMaxResponseTimeInSeconds to 30 seconds, but this makes no difference.

My time of testing and re-connecting is only about 10 seconds, so why would the timeout error still occur when the 30 second threshold hasn't been reached yet?


new LogEventRequest().SetEventKey("STORE_PLAYERCUSTOM_DATA")
            .SetDurable(true)
            .SetMaxQueueTimeInSeconds(30)
            .SetMaxResponseTimeInSeconds(30)
            .SetEventAttribute("USERNAME", Username)
            .Send(() => etc...
             

 




Best Answer

Hi Greg,


I've been doing some testing with timeouts and my conclusion is that whatever value you specify through SetMaxResponseTimeInSeconds() gets overridden (or simply not set). While offline, I started a timer when the request is sent and stopped it when I get the timeout error and it was always 5 sec whatever value I put in SetMaxResponseTimeInSeconds().


I noticed that in the PlatformBase.cs file, RequestTimeoutSeconds is set to 5. I tried changing this value to 10 and now my timer was returning 10 sec. My conclusion is that this is the value that GameSparks uses for its timeout duration and that somehow it is not being overridden when SetMaxResponseTimeInSeconds() is called. 


You can either edit the value in the PlatformBase Start() function itself or call GS.GSPlatform.RequestTimeoutSeconds = x; from anywhere is your code after GS is initialized.


Hope that will fix your problem.

Oliver


Hi,


If I do a Debug.Log of response.Errors.JSON, all I get is 

 {"error":"timeout"}

Hi Greg,

Can you please post the error that you are receiving ? 


Thanks,

Liam

Liam any update on this?

Answer

Hi Greg,


I've been doing some testing with timeouts and my conclusion is that whatever value you specify through SetMaxResponseTimeInSeconds() gets overridden (or simply not set). While offline, I started a timer when the request is sent and stopped it when I get the timeout error and it was always 5 sec whatever value I put in SetMaxResponseTimeInSeconds().


I noticed that in the PlatformBase.cs file, RequestTimeoutSeconds is set to 5. I tried changing this value to 10 and now my timer was returning 10 sec. My conclusion is that this is the value that GameSparks uses for its timeout duration and that somehow it is not being overridden when SetMaxResponseTimeInSeconds() is called. 


You can either edit the value in the PlatformBase Start() function itself or call GS.GSPlatform.RequestTimeoutSeconds = x; from anywhere is your code after GS is initialized.


Hope that will fix your problem.

Oliver

I'm using the Unity 5 SDK

Thanks Oliver, I have sent your response to GameSparks as an update to my ticket, I will let you know what they say.

No problems.

Also, I've done some tests with SetDurable() and I didn't find any difference between setting it to true or false. All the responses whose request got timed out will be received when connection is reestablished, whether SetDurable() is called with true or false.

"All the responses whose request got timed out will be received when connection is reestablished, whether SetDurable() is called with true or false."


is this true?

Greg, are you having this issue with the new Unity 5 sdk? I'm using with 3.2, and it works ok for me now.


Oliver, with SetDurable (), the request will persist even if the application is closed.


Login to post a comment