Java.Net.Socket.Bind Method
Binds this socket to the given local host address and port specified by the SocketAddress localAddr.

Syntax

[Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;)V", "GetBind_Ljava_net_SocketAddress_Handler")]
public virtual void Bind (SocketAddress localAddr)

Parameters

localAddr
the specific address and port on the local machine to bind to.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif the given SocketAddress is invalid or not supported.
Java.IO.IOExceptionif the socket is already bound or an error occurs while binding.

Remarks

Binds this socket to the given local host address and port specified by the SocketAddress localAddr. If localAddr is set to null, this socket will be bound to an available local address on any free port.

[Android Documentation]

Requirements

Namespace: Java.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1