class UdpSocket
source · line 19public
public class UdpSocket private constructor(private val owner: SocketOwner) : Closeable
- Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
An owned blocking datagram socket preserving message boundaries.
function localAddress
source · line 23public
public fun localAddress(): SocketAddress
Queries the actual bound UDP endpoint.
function sendTo
source · line 53public
public fun sendTo(buffer: NativeByteBuffer, destination: SocketAddress, count: Long = buffer.readableBytes): Long
Sends one datagram from count readable bytes and advances the buffer by the sent count.
parameter count
source · line 56public
count: Long = buffer.readableBytes
parameter destination
source · line 55public
destination: SocketAddress
parameter buffer
source · line 54public
buffer: NativeByteBuffer
function close
source · line 114public
public override fun close(): Unit
- Overrides
close
Closes the owned native descriptor; subsequent I/O through this owner is invalid.
function receiveFrom
source · line 87public
public fun receiveFrom(buffer: NativeByteBuffer, count: Long = buffer.writableBytes): Datagram
Receives one datagram into the writable region, returning sender, byte count, and truncation status.
parameter buffer
source · line 87public
buffer: NativeByteBuffer
parameter count
source · line 87public
count: Long = buffer.writableBytes
property isClosed
source · line 27public
public val isClosed: Boolean
get: public read-only
Whether this owned resource has been closed.
getter get
source · line 27public
get(): Boolean