2
votes

I am using Restlet 2.3.4, and I am trying to implement a timeout mechanism for Restlet Client accessing a server that is not responding.

I tried to select a bunch of different timeout parameters but without any success. What do I miss ?

Context context = new Context();
context.getParameters().add("idleTimeout", "1000");
context.getParameters().add("stopIdleTimeout", "1000");
context.getParameters().add("socketTimeout", "1000");
context.getParameters().add("maxIoIdleTimeMs", "1000");
context.getParameters().add("ioMaxIdleTimeMs", "1000");
client = new Client(context, Protocol.HTTP);
ClientResource service = new ClientResource(DBPEDIA_LOOKUP_SERVICE);
service.setNext(client);
service.setRetryOnError(false);
2

2 Answers

0
votes

After debugging the code (I'm using the version 2.3.6) I found out that the parameters are readTimeout and socketConnectTimeoutMs. In your case, it's the first one.