in Java1.4 you can check for a Socket's connection
state by calling isConnected()... Since your
SocksSocket is a socket object which contains a
reference to a real socket, you need to forward this
method on to the other one....
I did this in my code. The only caveat, though is
that it makes your code 1.4-only compatible.
Here's what I added to socks/SocksSocket.java
public boolean isConnected(){
return proxy!=null&&proxy.proxySocket!
=null&&proxy.proxySocket.isConnected();
}
public boolean isClosed(){
return proxy!=null&&proxy.proxySocket!
=null&&proxy.proxySocket.isClosed();
}
public boolean isInputShutdown(){
return proxy!=null&&proxy.proxySocket!
=null&&proxy.proxySocket.isInputShutdown();
}
public boolean isOutputShutdown(){
return proxy!=null&&proxy.isOutputShutdown!
=null&&proxy.proxySocket.isOutputShutdown();
}
Nobody/Anonymous
None
None
Public
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use