Add a log message when using StunMappingCandidateHarvester. (#238)
* log: Add a log message when using StunMappingCandidateHarvester. * ref: Use lambda, fix formating.
This commit is contained in:
parent
d7c0e27a1c
commit
d4a145374f
@ -199,8 +199,7 @@ public class MappingCandidateHarvesters
|
|||||||
if (face.getAddress().equals(h.getFace().getAddress())
|
if (face.getAddress().equals(h.getFace().getAddress())
|
||||||
&& mask.getAddress().equals(h.getMask().getAddress()))
|
&& mask.getAddress().equals(h.getMask().getAddress()))
|
||||||
{
|
{
|
||||||
logger.info("Discarding a mapping harvester with duplicate "
|
logger.info("Discarding a mapping harvester with duplicate addresses: " + harvester + ". Kept: " + h);
|
||||||
+ "addresses: " + harvester + ". Kept: " + h);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -263,21 +262,17 @@ public class MappingCandidateHarvesters
|
|||||||
TransportAddress localAddress
|
TransportAddress localAddress
|
||||||
= new TransportAddress(localInetAddress, 0, Transport.UDP);
|
= new TransportAddress(localInetAddress, 0, Transport.UDP);
|
||||||
|
|
||||||
|
logger.info("Using " + remoteAddress + " for StunMappingCandidateHarvester (localAddress="
|
||||||
|
+ localAddress + ").");
|
||||||
final StunMappingCandidateHarvester stunHarvester
|
final StunMappingCandidateHarvester stunHarvester
|
||||||
= new StunMappingCandidateHarvester(
|
= new StunMappingCandidateHarvester(
|
||||||
localAddress,
|
localAddress,
|
||||||
remoteAddress);
|
remoteAddress);
|
||||||
|
|
||||||
Callable<StunMappingCandidateHarvester> task
|
Callable<StunMappingCandidateHarvester> task = () ->
|
||||||
= new Callable<StunMappingCandidateHarvester>()
|
|
||||||
{
|
{
|
||||||
@Override
|
stunHarvester.discover();
|
||||||
public StunMappingCandidateHarvester call()
|
return stunHarvester;
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
stunHarvester.discover();
|
|
||||||
return stunHarvester;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
tasks.add(task);
|
tasks.add(task);
|
||||||
}
|
}
|
||||||
@ -285,8 +280,7 @@ public class MappingCandidateHarvesters
|
|||||||
|
|
||||||
// Now run discover() on all created harvesters in parallel and pick
|
// Now run discover() on all created harvesters in parallel and pick
|
||||||
// the ones which succeeded.
|
// the ones which succeeded.
|
||||||
ExecutorService es = ExecutorFactory.createFixedThreadPool(tasks.size(),
|
ExecutorService es = ExecutorFactory.createFixedThreadPool(tasks.size(), "ice4j.Harvester-executor-");
|
||||||
"ice4j.Harvester-executor-");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user