commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Buistov" <ABuis...@miratech.ua>
Subject RE: [httpclient] connection refused
Date Tue, 14 Oct 2003 08:29:11 GMT
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: commons-user@jakarta.apache.org
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:abuistov@miratech.ua


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


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


Mime
View raw message