Hi All,
I am using HttpClient 3 to send serialised objects to a servlet and back
again. I use the getResponseAsStream() on the post method to deserialise
responses. All works fine, until I sent back larger objects. Then the
close() on the inputStream or the releaseConnection() blocks for several
seconds, even thought I have already read the Object in. HEre is my code
// Send the message using Http Client
// and the MultiThreaded Connection Manager
client = new HttpClient(HttpMessagingProvider
.getConnectionManager());
method = new PostMethod(host);
InputStreamRequestEntity entity = new InputStreamRequestEntity(
getInputStream(inMessage));
method.setRequestEntity(entity);
method.setRequestHeader("Content-Type",
"application/octet-stream");
client.executeMethod(method);
long freddy = inMethod.getResponseContentLength();
if (freddy <= 0)
{
throw new IOException("only " + freddy
+ " bytes sent from server services");
}
BufferedInputStream bis =
new BufferedInputStream( inMethod.getResponseBodyAsStream() );
int num = bis.available();
ObjectInputStream ois = new ObjectInputStream( bis );
IAsynchMessage message = (IAsynchMessage) ois.readObject();
bis.close(); // blocks here when freddy is over 8000 bytes (
approx)
Tim
-----------------------------------------------
ABS Web Site: www.abs.gov.au
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]