Пример #1
0
  /** {@inheritDoc} */
  @Override
  protected IceSocketWrapper getCandidateIceSocketWrapper(SocketAddress remoteAddress) {
    for (IceSocketWrapper socket : sockets) {
      if (socket.getTCPSocket().getRemoteSocketAddress().equals(remoteAddress)) return socket;
    }

    return null;
  }
Пример #2
0
  @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();
  }