FileDocCategorySizeDatePackage
UDPTransport.javaAPI DocAzureus 3.0.3.43389Thu May 24 05:15:02 BST 2007com.aelitis.azureus.core.networkmanager.impl.udp

UDPTransport

public class UDPTransport extends com.aelitis.azureus.core.networkmanager.impl.TransportImpl

Fields Summary
private static final org.gudy.azureus2.core3.logging.LogIDs
LOGID
private ProtocolEndpointUDP
endpoint
private byte[]
shared_secrets
private int
transport_mode
private volatile boolean
closed
Constructors Summary
protected UDPTransport(ProtocolEndpointUDP _endpoint, byte[] _shared_secrets)

	
	
	
				
						 
	
		endpoint		= _endpoint;
		shared_secrets	= _shared_secrets;
	
protected UDPTransport(ProtocolEndpointUDP _endpoint, com.aelitis.azureus.core.networkmanager.impl.TransportHelperFilter _filter)

		endpoint		= _endpoint;
	
		setFilter( _filter );
	
Methods Summary
public voidclose(java.lang.String reason)

		closed	= true;
		
		readyForRead( false );
		readyForWrite( false );

		TransportHelperFilter	filter = getFilter();
		
		if ( filter != null ){
			
			filter.getHelper().close( reason );
			
			setFilter( null );
		}
	
public voidconnectOutbound(java.nio.ByteBuffer initial_data, ConnectListener listener)

		if ( !UDPNetworkManager.UDP_OUTGOING_ENABLED ){
			
			listener.connectFailure( new Throwable( "Outbound UDP connections disabled" ));
			
			return;
		}
		
		if ( closed ){
			
			listener.connectFailure( new Throwable( "Connection already closed" ));
			
			return;
		}
		    
		if( getFilter() != null ){
		     
			listener.connectFailure( new Throwable( "Already connected" ));
			
			return;
		}
		
		UDPConnectionManager	con_man = UDPNetworkManager.getSingleton().getConnectionManager();
		
		con_man.connectOutbound( this, endpoint.getAddress(), shared_secrets, initial_data, listener);
	
public java.lang.StringgetDescription()

		return( endpoint.getAddress().toString());
	
public intgetMssSize()

	  return( UDPNetworkManager.getUdpMssSize());
	
public com.aelitis.azureus.core.networkmanager.TransportEndpointgetTransportEndpoint()

		return( new TransportEndpointUDP( endpoint ));
	
public intgetTransportMode()

		return( transport_mode );
	
public booleanisClosed()

		return( closed );
	
public booleanisTCP()

 
		return( false );
	
public voidsetTransportMode(int mode)

		transport_mode	= mode;