> No can do. The idea is that *any* socket that *any*
> code running in the JVM (third-party JDBC drivers
> for instance) operate sockets with a timeout. We
> have no access to the code that is making most
> of the sockets.
> > No can do. The idea is that *any* socket that *any*
> > code running in the JVM (third-party JDBC drivers
[quoted text clipped - 11 lines]
>
> --
Drivers already have code to handle unexpected disconnects,
which manifest themselves in failed reads. The issue I'm trying
to deal with are people who test product failure capabilities
by pulling the network cable from the DBMS box. This causes socket
reads to hang for *ten minutes* until the local OS's TCPTIMEOUT
aborts the read. For drivers and other third-party code there is
no direct access to their sockets to either initialize them with
a timeout, or to free up the threads that hang. I did look into
setSocketImplFactory(), but I didn't find any public SocketImpl
to subclass. I can recommend the customer tweak their OS to have
a shorter TCP TIMEOUT values, but that affects every process. My
hack at least limited the change to the single JVM...
thanks,
Joe
Gordon Beaton - 12 Dec 2007 17:33 GMT
> I did look into setSocketImplFactory(), but I didn't find any public
> SocketImpl to subclass.
I think that's what java.net.SocketImpl is for.
http://java.sun.com/javase/6/docs/technotes/guides/net/extendingSocks.html
/gordon
--