class CoroutineDatagramChannel : CoroutineByteChannel, ScatteringCoroutineByteChannel, GatheringCoroutineByteChannel, CoroutineNetworkChannel
(source)
A co-routine based datagram-oriented network channel.
Author
Chris Leishman - https://cleishm.github.io/
val isConnected: Boolean
Indicates whether this channel is connected. |
|
val remoteAddress: SocketAddress
Get the remote address to which this channel is connected. |
fun bind(local: SocketAddress?): CoroutineDatagramChannel
Binds the channel's socket to a local address. |
|
fun close(): Unit
Closes this channel. |
|
fun connect(remote: SocketAddress): CoroutineDatagramChannel
Connect this channel. |
|
fun disconnect(): CoroutineDatagramChannel
Disconnects this channel. |
|
suspend fun receive(dst: ByteBuffer): SocketAddress
Receives a datagram via this channel. |
|
suspend fun send(src: ByteBuffer, target: SocketAddress): Int
Sends a datagram via this channel. |
|
fun tryReceive(dst: ByteBuffer): SocketAddress?
Receives a datagram via this channel, if one is immediately available. |
|
fun trySend(src: ByteBuffer, target: SocketAddress): Int
Sends a datagram via this channel, if it can be sent immediately. |
fun open(group: CoroutineChannelGroup = CommonCoroutineGroup): CoroutineDatagramChannel
Opens a datagram channel. |