if ( instance == my_instance ){
return;
}
InetAddress my_ext = my_instance.getExternalAddress();
InetAddress other_ext = instance.getExternalAddress();
if ( my_ext.isLoopbackAddress() ||
other_ext.isLoopbackAddress() ||
my_ext.equals( other_ext )){
String warning = null;
int my_tcp = my_instance.getTCPListenPort();
if ( my_tcp != 0 && my_tcp != last_warned_tcp && my_tcp == instance.getTCPListenPort()){
warning = "TCP " + my_tcp;
last_warned_tcp = my_tcp;
}
int my_udp = my_instance.getUDPListenPort();
int my_udp2 = my_instance.getUDPNonDataListenPort();
int other_udp = instance.getUDPListenPort();
int other_udp2 = instance.getUDPNonDataListenPort();
if ( my_udp != 0 && my_udp != last_warned_udp && ( my_udp == other_udp || my_udp == other_udp2 )){
warning = (warning==null?"":(warning + ", ")) + "UDP " + my_udp;
last_warned_udp = my_udp;
}
if ( my_udp != my_udp2 && my_udp2 != 0 && my_udp2 != last_warned_udp2 && ( my_udp2 == other_udp || my_udp2 == other_udp2 )){
warning = (warning==null?"":(warning + ", ")) + "UDP " + my_udp2;
last_warned_udp2 = my_udp2;
}
if ( warning != null ){
Logger.logTextResource(
new LogAlert(true, LogAlert.AT_WARNING,"azinstancehandler.alert.portclash"),
new String[]{
warning,
String.valueOf(RandomUtils.LISTEN_PORT_MIN ),
String.valueOf(RandomUtils.LISTEN_PORT_MAX)});
}
}