Package 

Class TcpHarvester

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      TcpHarvester(int port) Initializes a new TcpHarvester, which is to listen on port number port on all IP addresses on all available interfaces.
      TcpHarvester(int port, boolean ssltcp) Initializes a new TcpHarvester, which is to listen on port number port on all IP addresses on all available interfaces.
      TcpHarvester(int port, List<NetworkInterface> interfaces, boolean ssltcp) Initializes a new TcpHarvester, which is to listen on port number port on all the IP addresses on the specified NetworkInterfaces.
      TcpHarvester(List<TransportAddress> transportAddresses) Initializes a new TcpHarvester, which is to listen on the specified list of TransportAddresses.
      TcpHarvester(List<TransportAddress> transportAddresses, boolean ssltcp) Initializes a new TcpHarvester, which is to listen on the specified list of TransportAddresses.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      HarvestStatistics getHarvestStatistics() Returns the statistics describing how well the various harvests of this harvester went.
      void addMappedAddress(InetAddress publicAddress, InetAddress localAddress) Adds a mapping between publicAddress and localAddress.
      void addMappedPort(int port) Adds port as an additional port.
      Collection<LocalCandidate> harvest(Component component) Gathers all candidate addresses of the type that this CandidateHarvester supports.
      boolean isHostHarvester() Returns true if this CandidateHarvester is to be considered a harvester for host candidates.
      • Methods inherited from class org.ice4j.ice.harvest.AbstractTcpListener

        close
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TcpHarvester

        TcpHarvester(int port)
        Initializes a new TcpHarvester, which is to listen on port number port on all IP addresses on all available interfaces.
        Parameters:
        port - the port to listen on.
      • TcpHarvester

        TcpHarvester(int port, boolean ssltcp)
        Initializes a new TcpHarvester, which is to listen on port number port on all IP addresses on all available interfaces.
        Parameters:
        port - the port to listen on.
        ssltcp - true to use ssltcp; otherwise, false
      • TcpHarvester

        TcpHarvester(int port, List<NetworkInterface> interfaces, boolean ssltcp)
        Initializes a new TcpHarvester, which is to listen on port number port on all the IP addresses on the specified NetworkInterfaces.
        Parameters:
        port - the port to listen on.
        interfaces - the interfaces to listen on.
        ssltcp - true to use ssltcp; otherwise, false
      • TcpHarvester

        TcpHarvester(List<TransportAddress> transportAddresses)
        Initializes a new TcpHarvester, which is to listen on the specified list of TransportAddresses.
        Parameters:
        transportAddresses - the transport addresses to listen on.
      • TcpHarvester

        TcpHarvester(List<TransportAddress> transportAddresses, boolean ssltcp)
        Initializes a new TcpHarvester, which is to listen on the specified list of TransportAddresses.
        Parameters:
        transportAddresses - the transport addresses to listen on.
        ssltcp - true to use ssltcp; otherwise, false
    • Method Detail

      • addMappedAddress

         void addMappedAddress(InetAddress publicAddress, InetAddress localAddress)

        Adds a mapping between publicAddress and localAddress. This means that on harvest, along with any host candidates that have publicAddress, a server reflexive candidate will be added (with the same port as the host candidate).

        Parameters:
        publicAddress - the public address.
        localAddress - the local address.
      • addMappedPort

         void addMappedPort(int port)

        Adds port as an additional port. When harvesting, additional server reflexive candidates will be added with this port.

        Parameters:
        port - the port to add.
      • harvest

         Collection<LocalCandidate> harvest(Component component)

        Gathers all candidate addresses of the type that this CandidateHarvester supports. The gathered candidate addresses are to be added by this CandidateHarvester to the specified Component using Component#addLocalCandidate(LocalCandidate) as soon as they are discovered. Saves a (weak) reference to Component, so that it can be notified if/when a socket for one of it LocalCandidates is accepted.

        The method does not perform any network operations and should return quickly.

      • isHostHarvester

         boolean isHostHarvester()

        Returns true if this CandidateHarvester is to be considered a harvester for host candidates. Such a harvester should 1. Create local candidates of type HOST_CANDIDATE. 2. Not depend on other local candidates, already harvested for the component for which it is called. 3. Not perform blocking operations while harvesting.