> You don't need to patch anything though, simply extend HttpConnection and > override open() method to do what you need.
Yes, that is what I did. Otis > Alternatively, can we find a way to make InputSocketAddress at most a > compile-time dependency? > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 17, 2002 11:48 AM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: RE: HTTP Client: HttpConnection patch > > > That is what I was thinking. > However, it looks like java.net.InputSocketAddress 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 :( > > Otis > > > 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. > > http://java.sun.com/j2se/1.4/docs/guide/net/properties.html > > Let me know If I make sense... > > Antoan > > > > -----Original Message----- > > From: Otis Gospodnetic [mailto:[EMAIL PROTECTED]] > > Sent: Sunday, January 13, 2002 4:11 PM > > To: [EMAIL PROTECTED] > > 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 _________________________________________________________________ iVillage.com: Solutions for Your Life Check out the most exciting women's community on the Web http://www.ivillage.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
