Methods Summary |
---|
protected static com.aelitis.azureus.core.instancemanager.impl.AZOtherInstanceImpl | decode(java.net.InetAddress internal_address, java.util.Map map)
String id = new String((byte[])map.get( "id" ));
String int_ip = new String((byte[])map.get( "iip" ));
String ext_ip = new String((byte[])map.get( "eip" ));
int tcp = ((Long)map.get("tp" )).intValue();
int udp = ((Long)map.get("dp" )).intValue();
Long l_udp_other = (Long)map.get("dp2" );
int udp_other = l_udp_other==null?udp:l_udp_other.intValue();
try{
if ( !int_ip.equals("0.0.0.0")){
internal_address = InetAddress.getByName( int_ip );
}
InetAddress external_address = InetAddress.getByName( ext_ip );
return( new AZOtherInstanceImpl(id, internal_address, external_address, tcp, udp, udp_other ));
}catch( Throwable e ){
Debug.printStackTrace(e);
}
return( null );
|
protected long | getAliveTime()
long now = SystemTime.getCurrentTime();
if ( now < alive_time ){
alive_time = now;
}
return( alive_time );
|
public java.net.InetAddress | getExternalAddress()
return( external_address );
|
public java.lang.String | getID()
return( id );
|
public java.net.InetAddress | getInternalAddress()
return((InetAddress)internal_addresses.get(0));
|
protected java.util.List | getInternalAddresses()
return( internal_addresses );
|
public int | getTCPListenPort()
return( tcp_port );
|
public int | getUDPListenPort()
return( udp_port );
|
public int | getUDPNonDataListenPort()
return( udp_non_data_port );
|
protected boolean | update(com.aelitis.azureus.core.instancemanager.impl.AZOtherInstanceImpl new_inst)
alive_time = SystemTime.getCurrentTime();
InetAddress new_address = new_inst.getInternalAddress();
boolean same = true;
if ( !internal_addresses.contains( new_address )){
same = false;
List new_addresses = new ArrayList( internal_addresses );
new_addresses.add( 0, new_address );
internal_addresses = new_addresses;
}
same = same &&
external_address.equals( new_inst.external_address ) &&
tcp_port == new_inst.tcp_port &&
udp_port == new_inst.udp_port;
external_address = new_inst.external_address;
tcp_port = new_inst.tcp_port;
udp_port = new_inst.udp_port;
return( !same );
|