InetAddress.LocalHost Property

Definition

Returns the address of the local host.

public static Java.Net.InetAddress LocalHost { [Android.Runtime.Register("getLocalHost", "()Ljava/net/InetAddress;", "")] get; }
[<get: Android.Runtime.Register("getLocalHost", "()Ljava/net/InetAddress;", "")>]
static member LocalHost : Java.Net.InetAddress

Property Value

the address of the local host.

Attributes

Exceptions

if the address lookup fails.

Remarks

Returns the address of the local host. This is achieved by retrieving the name of the host from the system, then resolving that name into an InetAddress.

Note: The resolved address may be cached for a short period of time.

If there is a security manager, its checkConnect method is called with the local host name and -1 as its arguments to see if the operation is allowed. If the operation is not allowed, an InetAddress representing the loopback address is returned.

Java documentation for java.net.InetAddress.getLocalHost().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to