Partager via


Socket.LocalAddress Property

Definition

Gets the local address to which the socket is bound.

public virtual Java.Net.InetAddress? LocalAddress { [Android.Runtime.Register("getLocalAddress", "()Ljava/net/InetAddress;", "GetGetLocalAddressHandler")] get; }
[<get: Android.Runtime.Register("getLocalAddress", "()Ljava/net/InetAddress;", "GetGetLocalAddressHandler")>]
member this.LocalAddress : Java.Net.InetAddress

Property Value

the local address to which the socket is bound, the loopback address if denied by the security manager, or the wildcard address if the socket is closed or not bound yet.

Attributes

Remarks

Gets the local address to which the socket is bound.

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

Added in 1.1.

Java documentation for java.net.Socket.getLocalAddress().

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