David You would want to create a HttpState for each request You can use this variant of HttpClient's executeMethod for this
httpClient.executeMethod(hostConfiguration, httpMethod, httpstate); Please refer to http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/ httpclient/HttpClient.html#executeMethod(org.apache.commons.httpclient.H ostConfiguration, org.apache.commons.httpclient.HttpMethod, org.apache.commons.httpclient.HttpState) HTH!, Jaya. -----Original Message----- From: David Cotter [mailto:[EMAIL PROTECTED] Sent: Monday, December 04, 2006 3:01 PM To: HttpClient User Discussion Subject: Re: Many sockets open in CLOSE_WAIT state Cool thanks - I will check out these other methods. David. On 12/4/06, Roland Weber <[EMAIL PROTECTED]> wrote: > > Hello David, > > > In this case I would have to synchrozize this block of code > > > > synchronized(foo) { > > httpClient.setState(getStateForThisUser()); > > HttpMethod getMethod = new HttpMethod(); > > client.executeMethod(getMethod); > > saveStateForThisUser(httpClient.getState()) > > } > > No! I suggested to pass a user-specific state object *instead* of > using the default state. Your code would replace the default state > instead of not using it. > > > It seems to me I will have to synchronize until the method is > > complete > and > > the state in HttpClient updated which is quite a bottleneck. Or am I > missing > > something? > > Please have a look at the JavaDocs of the HttpClient class. > There are several execute methods, and almost all of them accept an > HttpState object as an argument (iirc). > > hope that helps, > Roland > > > > -- ----------------------------- David Cotter CTO Alatto Technologies Ltd ----------------------------- [EMAIL PROTECTED] m. +353 87 6293698 t. +353 1 2090700 (main) t. +353 1 2090779 (direct) f. +353 1 2090707 www.alatto.com ----------------------------- The new way to mobile browse: http://tribes.cc/demo ============================================================================================================================ Tech Mahindra, formerly Mahindra-British Telecom. Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra. ============================================================================================================================ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
