Package 

Class SimpleAddressDetector

  • All Implemented Interfaces:

    
    public class SimpleAddressDetector
    
                        

    The 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      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.
      TransportAddress getMappingFor(IceSocketWrapper socket) Creates a listening point for the specified socket and attempts to discover how its local address is NAT mapped.
      • Methods inherited from class java.lang.Object

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

      • SimpleAddressDetector

        SimpleAddressDetector(TransportAddress serverAddress)
        Creates a StunAddressDiscoverer.
        Parameters:
        serverAddress - the address of the server to interrogate.
    • Method Detail

      • 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.