tuweni / org.apache.tuweni.net.coroutines / CoroutineServerSocketChannel / bind

bind

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.

Parameters

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

Exceptions

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.

Parameters

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.

Exceptions

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