hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hezjing <hezj...@gmail.com>
Subject Re: Address already in use
Date Thu, 15 Nov 2007 07:07:26 GMT
I don't think I'm re-using the open connection. The following is how I
implement the Thread's run(),

    public final void run() {
        while (true) {
            GetMethod get = new GetMethod(url);
            try {
                int status = client.executeMethod(get);
                if (status != HttpStatus.SC_OK) {
                    System.err.println("Method failed: " + get.getStatusLine());
                }
            } catch (IOException e) {
                System.err.println(e);
            } finally {
                get.releaseConnection();
            }
        }
    }


and I started 10 of the above thread and it will cause the problem.


On 11/13/07, Oleg Kalnichevski <olegk@apache.org> wrote:
>
> On Mon, 2007-11-12 at 16:12 +0800, hezjing wrote:
> > Hi
> >
> > I'm using HttpClient 3.1, my program spawn multiple threads and keep
> > sending HTTP's GET to the web server and got the following exception:
> >
> > Nov 12, 2007 4:06:30 PM
> > org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
> > INFO: I/O exception (java.net.BindException) caught when processing
> > request: Address already in use
> >
> >
> > May I know how to resolve this problem?
> > How can the HttpClient reuse the address?
> >
>
> Are you re-using open connections?
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>


-- 

Hez

---------------------------------------------------------------------
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