net-coroutines / org.apache.tuweni.net.coroutines / CoroutineDatagramChannel / connect

connect

fun connect(remote: SocketAddress): CoroutineDatagramChannel (source)

Connect this channel.

The channel will be configured so that it only receives datagrams from, and sends datagrams to, the given remote peer address. Once connected, datagrams may not be received from or sent to any other address. A datagram channel remains connected until it is disconnected or closed.

Parameters

remote - The remote address to which this channel is to be connected.

Exceptions

ClosedChannelException - If the channel is closed.

AsynchronousCloseException - If another thread closes this channel while the connect operation is in progress.

ClosedByInterruptException - If another thread interrupts the current thread while the connect operation is in progress, thereby closing the channel and setting the current thread's interrupt status.

IOException - If some other I/O error occurs.

Return
This channel.