Here's a followup...
> Hi Sean,
> 
> I would have expected the other behavior as the JDK keeps HTTP connections
> alive by default.

This appears to be the case. I tried explicitly setting http.keepAlive to
true and http.maxConnections to say 50. Neither of these had any effect
on performance and, using ethereal, it is clear the connection 
is closed and reopened between calls using the same client.

Here's a typical request header and body:

POST /persons/person HTTP/1.1

User-Agent: Noelios-Restlet-Engine/1.0b20

Accept: */*

Content-Type: text/plain

Cache-Control: no-cache

Pragma: no-cache

Host: wasatch.overstock.com:8080

Connection: keep-alive

Content-Length: 147


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PersonRequest xmlns="http://www.overstock.com/service1";>
    <Id>20</Id>
</PersonRequest>

And a corresponding response header and body:

HTTP/1.1 200 OK

Date: Fri, 10 Nov 2006 23:04:01 GMT

Server: Noelios-Restlet-Engine/1.0b20

Content-Type: text/plain;charset=ISO-8859-1

Content-Length: 250



<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PersonResponse xmlns="http://www.overstock.com/service1";>
    <Id>20</Id>
    <Name>Sean</Name>
    <Phone>801-555-1212</Phone>
    <Time>2006-11-10T16:04:01.500-07:00</Time>
</PersonResponse>

> So, you may want to ensure that all your request entities (representations)
> have their "size" property precisely set.

The Content-Length values appear to be correct. 

> Also, feel free to have a look at
> the implementation classes (just two) to see if our usage of
> HttpURLConnection could be improved.

I couldn't see anything wrong with these and based on what I read on the
links, I wouldn't think the issue is in the Restlet code. 

Any other suggestions welcome.

Sean

Reply via email to