public class SimpleAddressDetector extends Object
Modifier and Type | Field and Description |
---|---|
private static Logger |
logger
Our class logger.
|
private BlockingRequestSender |
requestSender
A utility used to flatten the multi-threaded architecture of the Stack
and execute the discovery process in a synchronized manner
|
private TransportAddress |
serverAddress
The address of the stun server
|
private StunStack |
stunStack
The stack to use for STUN communication.
|
Constructor and Description |
---|
SimpleAddressDetector(TransportAddress serverAddress)
Creates a StunAddressDiscoverer.
|
Modifier and Type | Method and Description |
---|---|
TransportAddress |
getMappingFor(IceSocketWrapper socket)
Creates a listening point for the specified socket and attempts to
discover how its local address is NAT mapped.
|
TransportAddress |
getServerAddress()
Returns the server address that this detector is using to run stun
queries.
|
void |
shutDown()
Shuts down the underlying stack and prepares the object for garbage
collection.
|
void |
start()
Puts the discoverer into an operational state.
|
private static final Logger logger
private StunStack stunStack
private TransportAddress serverAddress
private BlockingRequestSender requestSender
public SimpleAddressDetector(TransportAddress serverAddress)
serverAddress
- the address of the server to interrogate.public TransportAddress getServerAddress()
public void shutDown()
public void start()
public TransportAddress getMappingFor(IceSocketWrapper socket) throws IOException, BindException
socket
- the socket whose address needs to be resolved.IOException
- if something fails along the way.BindException
- if we cannot bind the socket.Copyright © 2018. All rights reserved.