I've overcome the problem by using the following ugly code:
do {
try {
client.executeMethod(post);
break;
} catch (IOException e) {
try {
sleep(100);
} catch (InterruptedException e1) {
}
}
} while (true);
Is there more elegant solution?
-----Original Message-----
From: Alexey Buistov
Sent: Tuesday, October 14, 2003 10:14 AM
To: [EMAIL PROTECTED]
Subject: [httpclient] connection refused
Hello!
Executing this code
HttpClient client = new HttpClient();
HostConfiguration hc = new HostConfiguration();
hc.setHost("localhost", 1010);
client.setHostConfiguration(hc);
PostMethod post = new PostMethod();
String headerValue = Utils.stripQuote(soapActionHeader);
post.setRequestHeader("SOAPACTION", headerValue);
post.setRequestBody(requestBody);
client.executeMethod(post);
within different threads, I'm getting Exception "connection refused" starting from
about 30 threads.
Fewer amount of threads (about 10) works ok.
I'd like to know:
1) Is there any limitation on open sockets count on Windows that may cause such
Exception?
2) How should I avoid this Exception using HttpClient?
========
Alexey Buistov,
Software Engineer,
Miratech Ltd.
41 Nauki Ave,
03028 Kiev, Ukraine,
tel: +38 044 206 4090 ext number
+38 044 206 4099
fax: +38 044 206 4091
ICQ: 83154650
http://www.miratech.ua
mailto:[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]