diff --git a/src/main/java/org/ice4j/ice/harvest/SinglePortUdpHarvester.java b/src/main/java/org/ice4j/ice/harvest/SinglePortUdpHarvester.java index d9adfaa..e910cac 100644 --- a/src/main/java/org/ice4j/ice/harvest/SinglePortUdpHarvester.java +++ b/src/main/java/org/ice4j/ice/harvest/SinglePortUdpHarvester.java @@ -362,6 +362,12 @@ public class SinglePortUdpHarvester stunSocket, 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? synchronized (candidateSockets) diff --git a/src/main/java/org/ice4j/ice/harvest/TcpHarvester.java b/src/main/java/org/ice4j/ice/harvest/TcpHarvester.java index 752f5f8..d38fc88 100644 --- a/src/main/java/org/ice4j/ice/harvest/TcpHarvester.java +++ b/src/main/java/org/ice4j/ice/harvest/TcpHarvester.java @@ -518,6 +518,13 @@ public class TcpHarvester component.getParentStream().getParentAgent().getStunStack() .addSocket(stunSocket); 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 candidate/component to close/free it. }