AsynchronousServerSocketChannel.Bind Method

Definition

Overloads

Bind(SocketAddress)

Binds the channel's socket to a local address and configures the socket to listen for connections.

Bind(SocketAddress, Int32)

Binds the channel's socket to a local address and configures the socket to listen for connections.

Bind(SocketAddress)

Binds the channel's socket to a local address and configures the socket to listen for connections.

[Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;)Ljava/nio/channels/AsynchronousServerSocketChannel;", "", ApiSince=26)]
public Java.Nio.Channels.AsynchronousServerSocketChannel? Bind (Java.Net.SocketAddress? local);
[<Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;)Ljava/nio/channels/AsynchronousServerSocketChannel;", "", ApiSince=26)>]
member this.Bind : Java.Net.SocketAddress -> Java.Nio.Channels.AsynchronousServerSocketChannel

Parameters

local
SocketAddress

The local address to bind the socket, or null to bind to an automatically assigned socket address

Returns

This channel

Attributes

Remarks

Binds the channel's socket to a local address and configures the socket to listen for connections.

An invocation of this method is equivalent to the following: <blockquote>

bind(local, 0);

</blockquote>

Java documentation for java.nio.channels.AsynchronousServerSocketChannel.bind(java.net.SocketAddress).

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

Bind(SocketAddress, Int32)

Binds the channel's socket to a local address and configures the socket to listen for connections.

[Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;I)Ljava/nio/channels/AsynchronousServerSocketChannel;", "GetBind_Ljava_net_SocketAddress_IHandler", ApiSince=26)]
public abstract Java.Nio.Channels.AsynchronousServerSocketChannel? Bind (Java.Net.SocketAddress? local, int backlog);
[<Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;I)Ljava/nio/channels/AsynchronousServerSocketChannel;", "GetBind_Ljava_net_SocketAddress_IHandler", ApiSince=26)>]
abstract member Bind : Java.Net.SocketAddress * int -> Java.Nio.Channels.AsynchronousServerSocketChannel

Parameters

local
SocketAddress

The local address to bind the socket, or null to bind to an automatically assigned socket address

backlog
Int32

The maximum number of pending connections

Returns

This channel

Attributes

Remarks

Binds the channel's socket to a local address and configures the socket to listen for connections.

This method is used to establish an association between the socket and a local address. Once an association is established then the socket remains bound until the associated channel is closed.

The backlog parameter is the maximum number of pending connections on the socket. Its exact semantics are implementation specific. In particular, an implementation may impose a maximum length or may choose to ignore the parameter altogther. If the backlog parameter has the value 0, or a negative value, then an implementation specific default is used.

Java documentation for java.nio.channels.AsynchronousServerSocketChannel.bind(java.net.SocketAddress, int).

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