Properties

Link copied to clipboard

Current socket options

Functions

Link copied to clipboard
suspend fun bind(localAddress: SocketAddress? = null, configure: SocketOptions.UDPSocketOptions.() -> Unit = {}): BoundDatagramSocket

Bind server socket to listen to localAddress.

suspend fun bind(hostname: String = "0.0.0.0", port: Int = 0, configure: SocketOptions.UDPSocketOptions.() -> Unit = {}): BoundDatagramSocket

Bind server socket at port to listen to hostname.

Link copied to clipboard

Configure socket options in block function

Link copied to clipboard
suspend fun connect(    remoteAddress: SocketAddress,     localAddress: SocketAddress? = null,     configure: SocketOptions.UDPSocketOptions.() -> Unit = {}): ConnectedDatagramSocket

Create a datagram socket to listen datagrams at localAddress and set to remoteAddress.