Are you using MultiThreadedHttpConnectionManager?  Here is a link on the
example
http://svn.apache.org/viewvc/jakarta/httpcomponents/oac.hc3x/trunk/src/e
xamples/MultiThreadedExample.java?revision=554236&view=markup

Hope ths help.

Tony


-----Original Message-----
From: hezjing [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 15, 2007 2:07 AM
To: HttpClient User Discussion
Subject: Re: Address already in use


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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED]
>
>


-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-----------------------------------------
This e-mail message and any attachments contain confidential information
from Medco. If you are not the intended recipient, you are hereby
notified that disclosure, printing, copying, distribution, or the taking
of any action in reliance on the contents of this electronic information
is strictly prohibited. If you have received this e-mail message in
error, please immediately notify the sender by reply message and then
delete the electronic message and any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to