Page 1 of 1

What is the default timeout on the client?

Posted: Tue Jan 29, 2013 12:47 pm
by cchiu
Hello,

I was wondering what the default timeout is when we make a request to retrieve device information. Is this something I should be wrapping around with my own code or is there a way to set the timeout?

Thanks,
Clement

Re: What is the default timeout on the client?

Posted: Tue Jan 29, 2013 2:14 pm
by kamermans
Hi Clement,

I believe the default timeout is 1 second, but in some languages, like PHP using fsock, it is difficult to fully control the timeout. Which language are you using?

Re: What is the default timeout on the client?

Posted: Tue Jan 29, 2013 2:16 pm
by kamermans
Also, note that our load balancers are very picky about timing and they will give you a "HTTP/1.0 408 Request Time-out" if the request is not completed in 1 second, so the connection should not be left open unless there is something seriously wrong on your side.

Re: What is the default timeout on the client?

Posted: Tue Jan 29, 2013 2:42 pm
by cchiu
Hello,

I am using the Java client.
I just had wanted to make sure that in the unlikely event that the service is unreachable that I will not be spinning my wheels.
Thanks for the prompt reply.

Clement

Re: What is the default timeout on the client?

Posted: Thu Jun 20, 2013 7:01 am
by stefan66
Hi,

coming back on this issue, I could not find back in the documentation what happens when the services is unavailable. We call the service using Java:

Code: Select all

AbstractDevice device = manager.getDeviceFromRequest(request, response, CAPS);
In case the service is not available is an error thrown so I can catch it or does the device instance contains the errors I can get with using the getErrors() method ?

If so what are the possible key/value pairs in the map ?


Regards,

S.

Re: What is the default timeout on the client?

Posted: Mon Jun 24, 2013 3:55 am
by fulvio.crivellaro
Hello Clement,
in case of service unreachable, a com.scientiamobile.wurflcloud.exc.UnreachableServerException is thrown.
It is a RuntimeException, hence you are not forced to catch it.

The way it is supposed to be handled is:

Code: Select all

try {
    AbstractDevice device = manager.getDeviceFromRequest(request, response, CAPS);
} catch (UnreachableServerException) {
    // handle the exception
}
For what concerns the socket timeout, it depends on the JVM and/or the application server you are running, since the cloud client resides on environment default values.

Hope this fully answers your questions.

Regards,
Fulvio