public class StunMappingCandidateHarvester extends MappingCandidateHarvester
MappingCandidateHarvester
which uses a STUN servers to discover
its public IP address.Modifier and Type | Field and Description |
---|---|
private static Logger |
logger
The Logger used by the StunMappingCandidateHarvester
class and its instances for logging output.
|
private TransportAddress |
stunServerAddress
The list of servers we will use to discover our public address.
|
face, mask
Constructor and Description |
---|
StunMappingCandidateHarvester(TransportAddress localAddress,
TransportAddress stunServerAddress)
Initializes a new
StunMappingCandidateHarvester instance with
a given local address and a STUN server address. |
Modifier and Type | Method and Description |
---|---|
void |
discover()
Attempts to discover the the public address (mask) via the STUN server.
|
getFace, getMask, harvest, toString
getHarvestStatistics, isHostHarvester
private static final Logger logger
private TransportAddress stunServerAddress
public StunMappingCandidateHarvester(TransportAddress localAddress, TransportAddress stunServerAddress)
StunMappingCandidateHarvester
instance with
a given local address and a STUN server address. Note that the actual
discovery of the public address needs to be initiated to a separate call
to discover()
.localAddress
- The local address.stunServerAddress
- The address of the STUN server.Copyright © 2018. All rights reserved.