nu.najt.kecon.jsocksproxy
Class AbstractSocksImplementation

java.lang.Object
  extended by nu.najt.kecon.jsocksproxy.AbstractSocksImplementation
All Implemented Interfaces:
SocksImplementation
Direct Known Subclasses:
SocksImplementation4, SocksImplementation5

public abstract class AbstractSocksImplementation
extends java.lang.Object
implements SocksImplementation

The common implementation of the SOCKS protocol.

Author:
Kenny Colliander Nordin

Field Summary
protected  java.util.logging.Logger logger
           
 
Constructor Summary
AbstractSocksImplementation(JSocksProxy jSocksProxy, java.net.Socket socket, java.util.logging.Logger logger)
          Constructor
 
Method Summary
protected  java.net.Socket getSocket()
           
 java.lang.String getStatus()
           
protected  java.net.Socket openConnection(java.lang.String host, int port)
          Open a connection to remote destination
protected  void setStatus(java.lang.String status)
           
protected  void tunnel(java.net.Socket internal, java.net.Socket external)
          Tunnel input to output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nu.najt.kecon.jsocksproxy.SocksImplementation
handle
 

Field Detail

logger

protected final java.util.logging.Logger logger
Constructor Detail

AbstractSocksImplementation

public AbstractSocksImplementation(JSocksProxy jSocksProxy,
                                   java.net.Socket socket,
                                   java.util.logging.Logger logger)
Constructor

Parameters:
jSocksProxy - the socks proxy
socket - the socket
logger - the logger
Method Detail

openConnection

protected java.net.Socket openConnection(java.lang.String host,
                                         int port)
                                  throws java.io.IOException
Open a connection to remote destination

Parameters:
host - the host to connect to
port - the port to connect to
Returns:
established Socket
Throws:
java.io.IOException

tunnel

protected void tunnel(java.net.Socket internal,
                      java.net.Socket external)
Tunnel input to output

Parameters:
internal -
external -

getSocket

protected java.net.Socket getSocket()
Returns:
the socket

getStatus

public java.lang.String getStatus()
Returns:
the status

setStatus

protected void setStatus(java.lang.String status)
Parameters:
status - the status to set