feat: Adds socket from the single-port and TCP harvesters to the Component.

This commit is contained in:
Boris Grozev 2016-11-21 15:44:33 -06:00
parent 2718728e92
commit 25b0cfdc30
2 changed files with 13 additions and 0 deletions

View File

@ -362,6 +362,12 @@ public class SinglePortUdpHarvester
stunSocket, stunSocket,
new TransportAddress(remoteAddress, Transport.UDP)); new TransportAddress(remoteAddress, Transport.UDP));
// TODO: maybe move this code to the candidates.
MergingDatagramSocket componentSocket = component.getSocket();
if (componentSocket != null)
{
componentSocket.add(multiplexing);
}
// XXX is this necessary? // XXX is this necessary?
synchronized (candidateSockets) synchronized (candidateSockets)

View File

@ -518,6 +518,13 @@ public class TcpHarvester
component.getParentStream().getParentAgent().getStunStack() component.getParentStream().getParentAgent().getStunStack()
.addSocket(stunSocket); .addSocket(stunSocket);
candidate.addSocket(candidateSocket); candidate.addSocket(candidateSocket);
// TODO: Maybe move this code to the candidate.
MergingDatagramSocket componentSocket = component.getSocket();
if (componentSocket != null)
{
componentSocket.add(multiplexing);
}
// the socket is not our responsibility anymore. It is up to // the socket is not our responsibility anymore. It is up to
// the candidate/component to close/free it. // the candidate/component to close/free it.
} }