SocketChannel.Bind(SocketAddress) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Binds the channel's socket to a local address.
[Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;)Ljava/nio/channels/SocketChannel;", "GetBind_Ljava_net_SocketAddress_Handler", ApiSince=24)]
public abstract Java.Nio.Channels.SocketChannel? Bind(Java.Net.SocketAddress? local);
[<Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;)Ljava/nio/channels/SocketChannel;", "GetBind_Ljava_net_SocketAddress_Handler", ApiSince=24)>]
abstract member Bind : Java.Net.SocketAddress -> Java.Nio.Channels.SocketChannel
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 non-blocking connect 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
Added in 1.7.
Java documentation for java.nio.channels.SocketChannel.bind(java.net.SocketAddress).
Java reference for java.nio.channels.SocketChannel.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.