FileDocCategorySizeDatePackage
NetworkAdminTCPTester.javaAPI DocAzureus 3.0.3.42222Thu Jun 28 16:08:24 BST 2007com.aelitis.azureus.core.networkmanager.admin.impl

NetworkAdminTCPTester

public class NetworkAdminTCPTester extends Object implements NetworkAdminProtocolTester

Fields Summary
private com.aelitis.azureus.core.AzureusCore
core
Constructors Summary
protected NetworkAdminTCPTester(com.aelitis.azureus.core.AzureusCore _core)

		core	= _core;
	
Methods Summary
public java.net.InetAddresstestInbound(java.net.InetAddress bind_ip, int local_port)

		NatChecker	checker = new NatChecker( core, bind_ip, local_port, false );
		
		if ( checker.getResult() == NatChecker.NAT_OK ){
			
			return( checker.getExternalAddress());
			
		}else{
			
			throw( new NetworkAdminException( "NAT check failed: " + checker.getAdditionalInfo()));
		}
	
public java.net.InetAddresstestOutbound(java.net.InetAddress bind_ip, int bind_port)

		try{
			return( VersionCheckClient.getSingleton().getExternalIpAddressTCP(bind_ip, bind_port,false));
			
		}catch( Throwable e ){
			
			throw( new NetworkAdminException( "Outbound check failed", e ));
		}