-
- All Implemented Interfaces:
public class SimpleAddressDetectorThe class provides basic means of discovering a public IP address. All it does is send a binding request through a specified port and return the mapped address it got back or null if there was no response.
-
-
Field Summary
Fields Modifier and Type Field Description private TransportAddressserverAddress
-
Constructor Summary
Constructors Constructor Description SimpleAddressDetector(TransportAddress serverAddress)Creates a StunAddressDiscoverer.
-
Method Summary
Modifier and Type Method Description TransportAddressgetServerAddress()Returns the server address that this detector is using to run stun queries. voidshutDown()Shuts down the underlying stack and prepares the object for garbage collection. voidstart()Puts the discoverer into an operational state. TransportAddressgetMappingFor(IceSocketWrapper socket)Creates a listening point for the specified socket and attempts to discover how its local address is NAT mapped. -
-
Constructor Detail
-
SimpleAddressDetector
SimpleAddressDetector(TransportAddress serverAddress)
Creates a StunAddressDiscoverer.- Parameters:
serverAddress- the address of the server to interrogate.
-
-
Method Detail
-
getServerAddress
TransportAddress getServerAddress()
Returns the server address that this detector is using to run stun queries.
-
shutDown
void shutDown()
Shuts down the underlying stack and prepares the object for garbage collection.
-
start
void start()
Puts the discoverer into an operational state.
-
getMappingFor
TransportAddress getMappingFor(IceSocketWrapper socket)
Creates a listening point for the specified socket and attempts to discover how its local address is NAT mapped.
- Parameters:
socket- the socket whose address needs to be resolved.
-
-
-
-