Hi Mike, Thank you for your reply. I was confused yesterday and sent an unclear message. I think that I had two problems:
1. As described in the tutorial, I called releaseConnection() method after finishing reading the response body. But, as you indicated, "HttpMethods will automatically release connections when the response has been fully read." Calling the releaseConnection() method causes a socket connection exception thrown out. After I commented out the line in my code calling the releaseConnection() method, the exception is gone. 2. I got the Socket exception with the message saying "Connection reset by peer: ....". This exception may not caused by HttpClient. It probably caused by the IE finding that the image send back by the response was not changed and therefore stopped communication. It only happened when the MIME type of the response is image. Qingxian -----Original Message----- From: Michael Becke [mailto:[EMAIL PROTECTED] Sent: 25 August 2004 03:49 To: Jakarta Commons Users List Subject: Re: HttpClient releaseConnection() problem Hello Qingxian, Are you getting an exception? If so what does it look like? If not how are you determining that the connection is being incorrectly released? HttpMethods will automatically release connections when the response has been fully read. If you post some sample code and a wire log <http://jakarta.apache.org/commons/httpclient/logging.html> we could get a better idea of what's going on. Mike On Aug 24, 2004, at 6:06 AM, Qingxian Wang wrote: >> Hi, >> >> I am using HttpClient 2.0.1 with JBoss-3.0.2_Tomcat-4.0.4. >> >> I am using HttpClient to intercept the request from a Web browser to >> change some request headers and use the PostMethod to post the request >> contents to MicrosoftReport server. Then, the reponse body >> (PostMethod.getResponseBodyAsStream()) from the MicrosoftReport >> server is >> written to response to the Web browser. >> >> The following is the problem I encountered: >> While reading from the InputStream object returned by >> PostMethod.getResponseBodyAsStream() and writing to a >> HttpServletResponse >> object, HttpClient releases HttpConnection and cause the response >> partly >> writtent to the browser. >> > I have set the socket time out to infinite by calling: > httpClient.setTimeout(0). I cannot figure out what is wrong. Could > you > help me. > > Thanks. > > Qingxian > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
