FileDocCategorySizeDatePackage
AESocksProxyConnectionImpl.javaAPI DocAzureus 3.0.3.419267Thu Feb 09 19:42:52 GMT 2006com.aelitis.azureus.core.proxy.socks.impl

AESocksProxyConnectionImpl

public class AESocksProxyConnectionImpl extends Object implements AESocksProxyConnection, AEProxyConnectionListener
author
parg

Fields Summary
private static final LogIDs
LOGID
public static final boolean
TRACE
protected AESocksProxyImpl
proxy
protected AEProxyConnection
connection
protected boolean
disable_dns_lookups
protected SocketChannel
source_channel
protected int
socks_version
protected AESocksProxyPlugableConnection
plugable_connection
Constructors Summary
protected AESocksProxyConnectionImpl(AESocksProxyImpl _proxy, AESocksProxyPlugableConnectionFactory _connection_factory, AEProxyConnection _connection)

	
	
	
								
			
								 
	
		 
	
		proxy		= _proxy;
		connection	= _connection;
		
		connection.addListener( this );
		
		source_channel	= connection.getSourceChannel();
		
		try{
			plugable_connection	= _connection_factory.create( this );
		
			if ( TRACE ){
				Logger.log(new LogEvent(LOGID, "AESocksProxyProcessor: " + getName()));
			}
		}catch( AEProxyException e ){
			
			throw( new IOException( e.getMessage()));
		}
	
Methods Summary
public voidclose()

		new proxyStateClose();
	
public voidconnected()

		if ( socks_version == 4 ){
			
			new proxyStateV4Reply();
			
		}else{
			
			new proxyStateV5Reply();
		}
	
public voidconnectionClosed(AEProxyConnection con)

		try{
			if ( plugable_connection != null ){
				
				plugable_connection.close();
			}
			
		}catch( Throwable e ){
			
			Debug.printStackTrace( e );
		}
	
public voiddisableDNSLookups()

		disable_dns_lookups	= true;
	
public voidenableDNSLookups()

		disable_dns_lookups = false;
	
public AEProxyConnectiongetConnection()

		return( connection );
	
protected AEProxyStategetInitialState()

		return( new proxyStateVersion());
	
protected java.lang.StringgetName()

		String	name = connection.getName() + ", ver = " + socks_version;
					
		name += plugable_connection.getName();
		
		return( name );
	
public AESocksProxygetProxy()

		return( proxy );
	
public booleanisClosed()

		return( connection.isClosed());
	
public voidsetDelegate(AESocksProxyPlugableConnection target)

		plugable_connection = target;