fun bind(local: SocketAddress?): CoroutineServerSocketChannel
(source)
Overrides CoroutineNetworkChannel.bind
Binds the channel's socket to a local address and configures the socket to listen for connections.
local
- The local address to bind the socket, or null to bind to an automatically assigned socket address.
AlreadyBoundException
- If the socket is already bound.
UnsupportedAddressTypeException
- If the type of the given address is not supported.
ClosedChannelException
- If the channel is closed.
IOException
- If an I/O error occurs.
Return
This channel
fun bind(local: SocketAddress?, backlog: Int): CoroutineServerSocketChannel
(source)
Binds the channel's socket to a local address and configures the socket to listen for connections.
local
- The local address to bind the socket, or null to bind to an automatically assigned socket address.
backlog
- The maximum number of pending connections.
AlreadyBoundException
- If the socket is already bound.
UnsupportedAddressTypeException
- If the type of the given address is not supported.
ClosedChannelException
- If the channel is closed.
IOException
- If an I/O error occurs.
Return
This channel