DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=28322>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28322 Connection timeout logic redesign ------- Additional Comments From [EMAIL PROTECTED] 2004-04-12 12:27 ------- > I think we should change ControllerThreadSocketFactory.createSocket() > to accept a SocketFactory and all the other params necessary to create > the socket. This way we can hide the SocketTask from external > classes. Though we would end up passing in more params I think it would > make for a cleaner interface. Completely agree. The trouble is that javax.net.SocketFactory is available as of Java 1.4 only. I was thinking about using ProtocolSocketFactory instead but initially decided against it, as it results in a sort of logical recursion: a helper class takes a class as a parameter for which it acts as a helper class. Thinking about it causes stack overflow in my brain requiring a hard reboot with a glass of malt whisky. But I'll give it another shot, as it can potentially a lot of ugly code in the protocol socket factories > We should consider changing ProtocolSocketFactory.createSocket(host, > port ... timeout) to accept a HttpConnectionParams instead of a timeout. > This will allow for other config params in the future without requiring > API changes. Great idea > I think ReflectionSocketFactory.createSocket() should be changed to take a > SocketFactory instance instead of a socketFactoryName. This is not a major > change, but it seems a little cleaner to me. Same problem as in point 1 > I suggest we move the bulk of the reflection work from > ReflectionSocketFactory.createSocket() to a static initializer. > This way we can determine statically whether or not the JVM supports > Socket.connect() without testing each time. This may be premature > optimization, but my feeling is that it may be worth it. I seriously do not know what code may be moved to a static initializer unless we create a dummy socket and try calling connect on it. But to which port? Am I missing something? What if we just set a static flag: refection failed, do not try it again? Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]