Methods Summary |
---|
public static java.net.InetSocketAddress | adjustDHTAddress(java.net.InetSocketAddress address, boolean ext_to_lan)
if ( instance_manager == null ){
try{
instance_manager = AzureusCoreFactory.getSingleton().getInstanceManager();
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
if ( instance_manager == null || !instance_manager.isInitialized()){
return( address );
}
InetSocketAddress adjusted_address;
if ( ext_to_lan ){
adjusted_address = instance_manager.getLANAddress( address, AZInstanceManager.AT_UDP_NON_DATA );
}else{
adjusted_address = instance_manager.getExternalAddress( address, AZInstanceManager.AT_UDP_NON_DATA );
}
if ( adjusted_address == null ){
adjusted_address = address;
}else{
// System.out.println( "adj: " + address + "/" + ext_to_lan + " -> " + adjusted_address );
}
return( adjusted_address );
|
public static java.net.URL | adjustURL(java.net.URL url)
url = AEProxyFactory.getAddressMapper().internalise( url );
return( url );
|
public static byte | isLANLocalAddress(java.net.InetSocketAddress socket_address)
InetAddress address = socket_address.getAddress();
return( isLANLocalAddress( address ));
|
public static byte | isLANLocalAddress(java.net.InetAddress address)
// if someone passes us an unresolved address then handle sensibly
if ( address == null ){
return( LAN_LOCAL_NO );
}
if ( instance_manager == null ){
if ( AzureusCoreFactory.isCoreAvailable()){
try{
instance_manager = AzureusCoreFactory.getSingleton().getInstanceManager();
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
}
if ( instance_manager == null || !instance_manager.isInitialized()){
return( LAN_LOCAL_MAYBE );
}
return( instance_manager.isLANAddress( address )? LAN_LOCAL_YES:LAN_LOCAL_NO);
|
public static byte | isLANLocalAddress(java.lang.String address)
byte is_lan_local = LAN_LOCAL_MAYBE;
try {
is_lan_local = isLANLocalAddress( HostNameToIPResolver.syncResolve( address ));
}catch( Throwable t ){
t.printStackTrace();
}
return is_lan_local;
|