Michele Mazzucco wrote:
On Mon, 2007-04-23 at 13:19 -0400, Jake Goulding wrote:
Apologies for the second reply, but this may be a bit more of a
important question surrounding this issue. I have a multi-threaded
application, with each thread creating and using various Stubs
(sometimes multiple stubs to access various parts of the webservice). If
each Stub is creating its own HTTP server, how have I never run into an
issue like this before? It seems that each thread and each stub in that
thread would be trying to start a server on the same port.
Are you using 2 channels (i.e. options.setUseSeparateListener(true))?,
the http server is started *only* if you use a separate listener to
receive the response.
Nope. I didn't even know about this option until your email. :-D Does
this negate the whole of my problem? Why would I have a BindException if
I didn't set this option?
I can set the HTTPConstants.REUSE_HTTP_CLIENT option to true, but it
still seems like I may have some issues.
Which kind of problems are you getting?
Basically, while accessing Microsoft Sharepoint with 5 concurrent
threads, I am getting a bunch of BindExceptions.
However remember that it's up to you to clean the resources if you use a
custom ConfigurationContext. See
http://www.nabble.com/-Axis2--ServiceClient-question-tf2496516.html#a6959251
At what point do I need to do this cleanup? Just when I am done with
using axis? If so, I can cheat because my program should stop running at
about that time.
Is creating a global HttpClient and setting it in each thread (with
HTTPConstants.CACHED_HTTP_CLIENT) the "proper" thing to do?
http://jakarta.apache.org/commons/httpclient/performance.html#Reuse_of_HttpClient_instance
From this I gather it is OK to just create one HttpClient and use it in
multiple threads and stubs. I can also get a little performance benefit
out of it.
Do I seem on-track?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]