Share

Java SOCKS Proxy

Tracker: Bugs

5 isConnected fails on SocksSocket (jre 1.4) - ID: 1387344
Last Update: Tracker Item Submitted ( dovkatz )

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();
}


Dov Katz ( dovkatz ) - 2005-12-21 17:34

5

Open

None

Nobody/Anonymous

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.