Java.Net.ServerSocket.Bind Method
Binds this server socket to the given local socket address.

Syntax

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

Parameters

localAddr
the local machine address and port to bind on.
backlog
the maximum number of unaccepted connections. Passing 0 or a negative value yields the default backlog of 50.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif the SocketAddress is not supported.
Java.IO.IOExceptionif the socket is already bound or a problem occurs during binding.

Remarks

Binds this server socket to the given local socket address. If the localAddr is set to null the socket will be bound to an available local address on any free port of the system.

[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