Hi,

I'm using Restlet 2.1-RC5 with the Apache HTTP Client Connector, and I think
I've noticed some strange behaviour in a ClientResource's handling of its
context. At least one flag (tcpNoDelay) seems to be ignored when I put it into
the parameters of a ClientResource's context, like this:

----------
Context context = new Context();
context.getParameters().add("tcpNoDelay", "true");
fileResource = new ClientResource(context, MY_URL);
Representation rep = fileResource.get();
rep.exhaust();
----------

On the other hand, the TCP_NODELAY flag seems to be set just fine when I set it
in the following way:

----------
Context context = new Context();
context.getParameters().add("tcpNoDelay", "true");
fileResource = new ClientResource(context, MY_URL);
Client client = new Client(context, protocol);
fileResource.setNext(client);
Representation rep = fileResource.get();
rep.exhaust();
----------

If I do many small requests in succession over a HTTPS connection, this leads
to a huge difference in performance (the client using the second code snippet
is faster than the one using the first by a factor of about 9 for my test 
case). However,
even with a single standard HTTP request without SSL, debugging reveals that
the difference is there: I set a breakpoint at

org.restlet.engine.adapter.HttpClientHelper.handle(Request request, Response 
response)

and watched the attribute this.httpClient.defaultParams.parameters. If I
use the first code snippet, this map contains the entry http.tcp.nodelay=false.
On the other hand, for the second code snippet, this entry is
http.tcp.nodelay=true.

best regards,
Andreas

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2974370

Reply via email to