|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.net.ServerSocket | +--socks.SocksServerSocket
SocksServerSocket allows to accept connections from one particular host through the SOCKS4 or SOCKS5 proxy.
Constructor Summary | |
SocksServerSocket(java.net.InetAddress ip,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses default Proxy. |
|
SocksServerSocket(Proxy p,
java.net.InetAddress ip,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses given proxy. |
|
SocksServerSocket(Proxy p,
java.lang.String host,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses given proxy. |
|
SocksServerSocket(java.lang.String host,
int port)
Creates ServerSocket capable of accepting one connection through the firewall, uses default Proxy. |
Method Summary | |
java.net.Socket |
accept()
Accepts the incoming connection. |
void |
close()
Closes the connection to proxy if socket have not been accepted, if the direct connection is used, closes direct ServerSocket. |
java.lang.String |
getHost()
Get the name of the host proxy is using to listen for incoming connection. |
java.net.InetAddress |
getInetAddress()
Get address assigned by proxy to listen for incomming connections, or the local machine address if doing direct connection. |
int |
getLocalPort()
Get port assigned by proxy to listen for incoming connections, or the port chosen by local system, if accepting directly. |
void |
setSoTimeout(int timeout)
Set Timeout. |
Methods inherited from class java.net.ServerSocket |
getSoTimeout,
setSocketFactory,
toString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SocksServerSocket(java.lang.String host, int port) throws SocksException, java.net.UnknownHostException, java.io.IOException
host
- Host from which the connection should be recieved.port
- Port number of the primary connection.public SocksServerSocket(Proxy p, java.lang.String host, int port) throws SocksException, java.net.UnknownHostException, java.io.IOException
p
- Proxy object to use.host
- Host from which the connection should be recieved.port
- Port number of the primary connection.public SocksServerSocket(java.net.InetAddress ip, int port) throws SocksException, java.io.IOException
ip
- Host from which the connection should be recieved.port
- Port number of the primary connection.public SocksServerSocket(Proxy p, java.net.InetAddress ip, int port) throws SocksException, java.io.IOException
p
- Proxy object to use.ip
- Host from which the connection should be recieved.port
- Port number of the primary connection.Method Detail |
public java.net.Socket accept() throws java.io.IOException
public void close() throws java.io.IOException
public java.lang.String getHost()
Usefull when address is returned by proxy as the hostname.
public java.net.InetAddress getInetAddress()
public int getLocalPort()
public void setSoTimeout(int timeout) throws java.net.SocketException
timeout
- Amount of time in milliseconds, accept should wait for
incoming connection before failing with exception.
Zero timeout implies infinity.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |