/** {@inheritDoc} */ @Override protected IceSocketWrapper getCandidateIceSocketWrapper(SocketAddress remoteAddress) { for (IceSocketWrapper socket : sockets) { if (socket.getTCPSocket().getRemoteSocketAddress().equals(remoteAddress)) return socket; } return null; }
@Override protected void free() { StunStack stunStack = getStunStack(); TransportAddress localAddr = getTransportAddress(); for (IceSocketWrapper socket : sockets) { // remove our sockets from the stack. Socket tcpSocket = socket.getTCPSocket(); stunStack.removeSocket( localAddr, new TransportAddress(tcpSocket.getInetAddress(), tcpSocket.getPort(), Transport.TCP)); socket.close(); } super.free(); }