commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Waldhoff, Rodney" <>
Subject RE: HTTP Client: HttpConnection patch
Date Thu, 17 Jan 2002 19:05:22 GMT
Since 1.4 is not yet out of beta, and I believe the current HTTP Client
support extends not just to 1.3, but also to 1.2 (and with some changes to
the internal implementation only, all the way down to 1.1), I'm not sure
requiring 1.4 at both build and runtime is such a good idea at this point.

You don't need to patch anything though, simply extend HttpConnection and
override open() method to do what you need.

Alternatively, can we find a way to make InputSocketAddress at most a
compile-time dependency?

-----Original Message-----
From: []
Sent: Thursday, January 17, 2002 11:48 AM
Subject: RE: HTTP Client: HttpConnection patch

That is what I was thinking.
However, it looks like doesn't exist in 1.3
version, so I cannot use that class directly (or am I missing something).
I guess I'll have to just keep patching my local copy of HttpConnect :(


On Sun, 13 January 2002, "Antoan Nikolaev" wrote:

> Hi, I am new to this list, but very interested in your HttpClient.
> You are talking about reding system properties for the timeouts.
> JDK1.4 already has such properties, you might want to use the same in
> your 1.3 implementation,
> So when you migrate to 1.4, you won't have to do anything more.
> Let me know If I make sense...
> Antoan
> -----Original Message-----
> From: Otis Gospodnetic [] 
> Sent: Sunday, January 13, 2002 4:11 PM
> To:
> Subject: HTTP Client: HttpConnection patch
> Hello,
> A few times I mentioned that HttpConnection hangs when it encounters 
> servers that are down, unreachable, etc.
> I did a bit of debugging and it appears that it is calls to 'new 
> Socket(....)' that are blocking.  Furthermore, it looks like there is no
> simple cure for that in Java's version 1.3 of the API.
> However, JDK 1.4 exposes a 'connect' method in Socket class, which 
> allows a timeout value to be specified.
> I modified my local version of HttpClient to use that and it works 
> perfectly.  I was doing tests with a set of about 1150 URLs and 10 
> threads.  Before this change it would take about 16 minutes to fetch 
> 1150 pages, and now it takes about 3. Note that I hard-coded the connect
> timeout value, but I realize that the default value should probably be 
> in a static final int and that we should probably expose this via a 
> public method that allows one to set the timeout value.
> I understand that not everyone will want to use it, but it may be good 
> to apply this patch anyway and then comment it out, so that it is easy 
> for people to uncomment it out and use it.  Or perhaps HttpConnection 
> could check one of the System properties that shows the JVM version and
> use either the old or the new code, depending on the property.
> What do you think?
> Otis
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

_________________________________________________________________ Solutions for Your Life 
Check out the most exciting women's community on the Web

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message