Language

AsynchronousSocketChannel.Bind(SocketAddress) Method

Definition

Binds the channel's socket to a local address.

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

Parameters

local
SocketAddress

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

Returns

This channel

Attributes

Exceptions

If a connection operation is already in progress on this channel

If the socket is already bound.

If the type of the given address is not supported.

If the channel is closed.

If some other I/O error occurs.

If a security manager has been installed and its checkListen method denies the operation

Remarks

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

Java reference for java.nio.channels.AsynchronousSocketChannel.bind.

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