hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Angso, Tony" <Tony_An...@medco.com>
Subject RE: Address already in use
Date Thu, 15 Nov 2007 14:44:15 GMT
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:hezjing@gmail.com] 
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 <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


-----------------------------------------
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: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message