hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pfingstl Gernot" <gernot.pfing...@stmk.gv.at>
Subject MultiThreadedHttpConnectionManager
Date Thu, 27 Jan 2005 07:03:32 GMT

I'm using httpClient in a webapplication, so I had to use MultiThreadedHttpConnectionManager.
In the httpClient docs there's a example how to use MultiThreadedHttpConnectionManager:
	MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
	HttpClient client = new HttpClient(connectionManager);
And there's the sentence "This instance of HttpClient can now be used to execute multiple
methods from multiple threads".  This works fine! But now I want to use one HttpClient for
a session. So I have one HttpClient instance per session, which of course is also multithreaded.
So my question: Can I use MultiThreadedHttpConnectionManager in this way:
	MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
	HttpClient client1 = new HttpClient(connectionManager);
	HttpClient client2 = new HttpClient(connectionManager);
	HttpClient client3 = new HttpClient(connectionManager);
	...
or do I have to use it this way:
	MultiThreadedHttpConnectionManager connectionManager1 = new MultiThreadedHttpConnectionManager();
	HttpClient client1 = new HttpClient(connectionManager1);
	MultiThreadedHttpConnectionManager connectionManager2 = new MultiThreadedHttpConnectionManager();
	HttpClient client2 = new HttpClient(connectionManager2);
	...
(client1,...,clientN are used in multiple threads)

Thank you,
Gernot


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message