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

NetworkAdminHTTPTester

public class NetworkAdminHTTPTester extends Object implements NetworkAdminProtocolTester

Fields Summary
private com.aelitis.azureus.core.AzureusCore
core
Constructors Summary
protected NetworkAdminHTTPTester(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, true );
		
		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)

		if ( bind_ip != null || bind_port != 0 ){
			
			throw( new NetworkAdminException("HTTP tester doesn't support local bind options"));
		}
		
		try{
			return( VersionCheckClient.getSingleton().getExternalIpAddressHTTP(false));
			
		}catch( Throwable e ){
			
			throw( new NetworkAdminException( "Outbound test failed", e ));
		}