fm.liveswitch.ServerAddress Class Reference

An IP address and port, along with optional public IP addresses for listening behind a 1:1 NAT. More...

Public Member Functions

String getPublicIPAddress ()
 Gets the first public IP address. More...
 
String[] getPublicIPAddresses ()
 Gets the public IP addresses. More...
 
 ServerAddress (String ipAddress, int port)
 Initializes a new instance of the fm.liveswitch.ServerAddress class. More...
 
 ServerAddress (String ipAddress, int port, String publicIPAddress)
 Initializes a new instance of the fm.liveswitch.ServerAddress class. More...
 
 ServerAddress (String ipAddress, int port, String[] publicIPAddresses)
 Initializes a new instance of the fm.liveswitch.ServerAddress class. More...
 
- Public Member Functions inherited from fm.liveswitch.TransportAddress
boolean equals (Object obj)
 Determines whether the specified object is equal to this instance. More...
 
fm.liveswitch.AddressType getAddressType ()
 Gets the address type. More...
 
String getIPAddress ()
 Gets the IP address. More...
 
int getPort ()
 Gets the port. More...
 
int hashCode ()
 Returns a hash code for this instance. More...
 
void setIPAddress (String value)
 Sets the IP address. More...
 
void setPort (int value)
 Sets the port. More...
 
String toString ()
 Returns a string that represents this instance. More...
 
 TransportAddress (String ipAddress, int port)
 Initializes a new instance of the fm.liveswitch.TransportAddress class. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from fm.liveswitch.TransportAddress
static boolean checkMask (String address1, String address2, String mask)
 Compares two addresses to see if they are on the same subnet. More...
 
static boolean is6To4 (String ipAddress)
 Determines whether the specified IP address is a 6to4 address. More...
 
static boolean isAny (String ipAddress)
 Determines whether the specified IP address is all zeros and represents "any" IP address. More...
 
static boolean isDiscard (String ipAddress)
 Determines whether the specified IP address is a discard address. More...
 
static boolean isDocumentation (String ipAddress)
 Determines whether the specified IP address is a documentation address. More...
 
static boolean isIPAddress (String address)
 Determines whether a string is a valid IPv4 or IPv6 address. More...
 
static boolean isIPv4 (String ipAddress)
 Determines whether the specified IP address is IPv4. More...
 
static boolean isIPv6 (String ipAddress)
 Determines whether the specified IP address is IPv6. More...
 
static boolean isLimitedBroadcast (String ipAddress)
 Determines whether the specified IP address is a limited broadcast address. More...
 
static boolean isLinkLocal (String ipAddress)
 Determines whether the specified IP address is a link-local address. More...
 
static boolean isLoopback (String ipAddress)
 Determines whether the specified IP address is a loopback address. More...
 
static boolean isMulticast (String ipAddress)
 Determines whether the specified IP address is a multicast address. More...
 
static boolean isOrchid (String ipAddress)
 Determines whether the specified IP address is an ORCHID address. More...
 
static boolean isPrivate (String ipAddress)
 Determines whether the specified IP address is a private address. More...
 
static boolean isReserved (String ipAddress)
 Determines whether the specified IP address is a reserved address. More...
 
static boolean isSource (String ipAddress)
 Determines whether the specified IP address is a source address. More...
 
static boolean isTeredo (String ipAddress)
 Determines whether the specified IP address is a Teredo address. More...
 
static String maskFromPrefixLength (int prefixLength)
 Gets a subnet mask from an IPv4 prefix length (0-32). More...
 
static String maskFromPrefixLength (int prefixLength, boolean ipv6)
 Gets a subnet mask from an IPv4 or IPv6 prefix length (0-32 or 0-128). More...
 
static String sanitizeIPAddress (String ipAddress)
 Sanitizes the IP address, removing any local information. More...
 

Detailed Description

An IP address and port, along with optional public IP addresses for listening behind a 1:1 NAT.

Constructor & Destructor Documentation

◆ ServerAddress() [1/3]

fm.liveswitch.ServerAddress.ServerAddress ( String  ipAddress,
int  port 
)

Initializes a new instance of the fm.liveswitch.ServerAddress class.

Parameters
ipAddressThe IP address.
portThe port.

◆ ServerAddress() [2/3]

fm.liveswitch.ServerAddress.ServerAddress ( String  ipAddress,
int  port,
String  publicIPAddress 
)

Initializes a new instance of the fm.liveswitch.ServerAddress class.

Parameters
ipAddressThe IP address.
portThe port.
publicIPAddressThe public IP address.

◆ ServerAddress() [3/3]

fm.liveswitch.ServerAddress.ServerAddress ( String  ipAddress,
int  port,
String[]  publicIPAddresses 
)

Initializes a new instance of the fm.liveswitch.ServerAddress class.

Parameters
ipAddressThe IP address.
portThe port.
publicIPAddressesThe public IP addresses.

Member Function Documentation

◆ getPublicIPAddress()

String fm.liveswitch.ServerAddress.getPublicIPAddress ( )

Gets the first public IP address.

◆ getPublicIPAddresses()

String [] fm.liveswitch.ServerAddress.getPublicIPAddresses ( )

Gets the public IP addresses.