Package org.ros.address
Class AdvertiseAddress
java.lang.Object
org.ros.address.AdvertiseAddress
A wrapper for
InetSocketAddress that emphasizes the difference
between an address that should be used for binding a server port and one that
should be advertised to external entities.
An AdvertiseAddress encourages lazy lookups of port information to
prevent accidentally storing a bind port (e.g. 0 for OS picked) instead of
the advertised port.- Author:
- damonkohler@google.com (Damon Kohler)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetHost()intgetPort()inthashCode()booleanstatic AdvertiseAddressstatic AdvertiseAddressBest effort method, returns a newAdvertiseAddresswhere the host is determined automatically.voidsetPortCallable(Callable<Integer> portCallable) voidsetStaticPort(int port) toString()
-
Constructor Details
-
AdvertiseAddress
-
-
Method Details
-
newPrivate
-
newPublic
Best effort method, returns a newAdvertiseAddresswhere the host is determined automatically.- Returns:
- a suitable
AdvertiseAddressfor a publicly accessibleBindAddress
-
getHost
-
setStaticPort
public void setStaticPort(int port) -
getPort
public int getPort() -
setPortCallable
-
toInetAddress
-
toInetSocketAddress
-
toUri
-
isLoopbackAddress
public boolean isLoopbackAddress() -
toString
-
hashCode
public int hashCode() -
equals
-