ServerSocketChannel.Bind 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.
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/ServerSocketChannel;", "", ApiSince=24)]
public Java.Nio.Channels.ServerSocketChannel? Bind (Java.Net.SocketAddress? local);
[<Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;)Ljava/nio/channels/ServerSocketChannel;", "", ApiSince=24)>]
member this.Bind : Java.Net.SocketAddress -> Java.Nio.Channels.ServerSocketChannel
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>
Added in 1.7.
Java documentation for java.nio.channels.ServerSocketChannel.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/ServerSocketChannel;", "GetBind_Ljava_net_SocketAddress_IHandler", ApiSince=24)]
public abstract Java.Nio.Channels.ServerSocketChannel? Bind (Java.Net.SocketAddress? local, int backlog);
[<Android.Runtime.Register("bind", "(Ljava/net/SocketAddress;I)Ljava/nio/channels/ServerSocketChannel;", "GetBind_Ljava_net_SocketAddress_IHandler", ApiSince=24)>]
abstract member Bind : Java.Net.SocketAddress * int -> Java.Nio.Channels.ServerSocketChannel
Parameters
- local
- SocketAddress
The 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 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.
Added in 1.7.
Java documentation for java.nio.channels.ServerSocketChannel.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.