The Internet Protocol address.
The instantiation of this class is always done by the engine. A user usually provides an IP address, or a host name to one of static resolver methods on this class to get an instance of the resolved address.
Parent Class
Type | Name | Signature |
---|---|---|
method | getAddress | public String getAddress() |
method S | getLocal | public static NetAddress getLocal() |
method S | getLoopback | public static NetAddress getLoopback() |
method | getName | public String getName() |
method | getType | public AddressType getType() |
method | isLoopback | public bool isLoopback() |
method S | resolve | public static NetAddress resolve(string) |
method S | resolveAll | public static NetAddress[] resolveAll(string) |
public String getAddress()
Get host address as either specified or resolved from the host name. If the address was created by a host name but turned out to be unresolvable, returns null.
Returns
public static NetAddress getLocal()
Get the local address. The address is resolved from local host name.
Returns
public static NetAddress getLoopback()
Get an IPv4 loopback address.
Returns
public String getName()
Get the host name if this instance is resolved from it. If it is created by an address literal this method returns the same string value.
Returns
public AddressType getType()
Get the type of this IP address.
Returns
public bool isLoopback()
Whether this address is a local loopback. Such address is backed by a virtual loopback network device provided by the OS. Data coming from and to this address doesn't incur traffic on data link layer.
Returns
public static NetAddress resolve(string name)
Try to resolve the host name to an address.
If the name is an address itself no resolution will occur and the argument will be directly converted to an address object.
Required Policies
System.Network/resolve
Parameters
Returns
public static NetAddress[] resolveAll(string name)
Try to resolve the host name to as many addresses as possible.
If the name is an address itself no resolution will occur and the resultant array will only contain one address from the given name.
Required Policies
System.Network/resolve
Parameters
Returns