fix: Closes the MultiplexingDatagramSocket instances created by single-port UDP candidates.

This commit is contained in:
Boris Grozev 2017-04-10 13:47:22 -05:00
parent 5085b042bb
commit a524e1b2c0

View File

@ -307,6 +307,11 @@ public class SinglePortUdpHarvester
synchronized (candidateSockets)
{
for (IceSocketWrapper wrapper : candidateSockets.values())
{
wrapper.close();
}
candidateSockets.clear();
}
@ -372,7 +377,14 @@ public class SinglePortUdpHarvester
// XXX is this necessary?
synchronized (candidateSockets)
{
candidateSockets.put(remoteAddress, candidateSocket);
IceSocketWrapper oldSocket
= candidateSockets.put(remoteAddress, candidateSocket);
if (oldSocket != null)
{
logger.warning("Replacing the socket for remote address "
+ remoteAddress);
oldSocket.close();
}
}
// XXX is this necessary?