Hello,
in the context of a test client (exerting a number of Web Service calls to a WS server), I often face the following exceptions on the Windows client machine:
java.net.BindException: Address already in use: connect
For reference, I opened a topic [on this subject|http://forums.sun.com/thread.jspa?threadID=5394391] last year, however I was focused on how to solve the problem by intercepting socket creation request by JAX-WS, and fiddling with socket options, but that smelled like a bad idea.
I then opened a topic in the networking forum as to [how to install a custom socket factory|http://forums.sun.com/thread.jspa?messageID=10757650#10757650] and deal with, or observe, the socket-level work, but haven't found an answer so far (although I did learn a lot of helpful things about networking along the way).
One thing that puzzles me, is that the exception mentioned above seems to indicate a local port exhaustion, whereas the OS netstat suggests otherwise.
I know, as per [an article|http://technet.microsoft.com/fr-fr/library/bb878133%28en-us%29.aspx] in Microsoft knowledge base, and as per some descriptions of similar problems on the Web, that it is normal to exhaust the default ~3980 local ports of a Windows system if one uses that many local ports within the 2*MSL TCP window of lingering closed sockets, however my Windows' netstat show no more than 300 local ports in TIME_WAIT, and no more than 1500 local ports used at all, when this exception occurs.
So, I'm openeing this 3rd topic to ask what could cause this problem
in the scope of JAX-WS, and how to avoid or correct it in this context.
A good link in the inner workings of the client end of JAX-WS would help a lot too.
Thank you in advance,
J.