-
- All Implemented Interfaces:
-
org.ice4j.ice.harvest.CandidateHarvester
public class StunMappingCandidateHarvester extends MappingCandidateHarvester
A MappingCandidateHarvester which uses a STUN servers to discover its public IP address.
-
-
Constructor Summary
Constructors Constructor Description StunMappingCandidateHarvester(TransportAddress localAddress, TransportAddress stunServerAddress)Initializes a new StunMappingCandidateHarvester instance with a given local address and a STUN server address.
-
Method Summary
Modifier and Type Method Description voiddiscover()Attempts to discover the the public address (mask) via the STUN server. TransportAddressgetFace()TransportAddressgetMask()-
Methods inherited from class org.ice4j.ice.harvest.MappingCandidateHarvester
getMatchPort, getName, harvest, publicAddressMatches -
Methods inherited from class org.ice4j.ice.harvest.AbstractCandidateHarvester
getHarvestStatistics, isHostHarvester -
Methods inherited from class org.ice4j.ice.harvest.CandidateHarvester
harvest -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
StunMappingCandidateHarvester
StunMappingCandidateHarvester(TransportAddress localAddress, TransportAddress stunServerAddress)
Initializes a new StunMappingCandidateHarvester instance with a given local address and a STUN server address.- Parameters:
localAddress- The local address.stunServerAddress- The address of the STUN server.
-
-
Method Detail
-
discover
void discover()
Attempts to discover the the public address (mask) via the STUN server. Note that this will block until we either receive a response from the STUN server, or a timeout occurs.
-
getFace
@Nullable() TransportAddress getFace()
-
getMask
@Nullable() TransportAddress getMask()
-
-
-
-