ktor-network / io.ktor.network.sockets / UDPSocketBuilder

UDPSocketBuilder

class UDPSocketBuilder : Configurable<UDPSocketBuilder, UDPSocketOptions>

UDP socket builder

Constructors

<init>

UDPSocketBuilder(selector: SelectorManager, options: UDPSocketOptions)

UDP socket builder

Properties

options

var options: UDPSocketOptions

Current socket options

Functions

bind

fun bind(localAddress: <ERROR CLASS>? = null, configure: UDPSocketOptions.() -> Unit = {}): BoundDatagramSocket

Bind server socket to listen to localAddress.

connect

fun connect(remoteAddress: <ERROR CLASS>, localAddress: <ERROR CLASS>? = null, configure: UDPSocketOptions.() -> Unit = {}): ConnectedDatagramSocket

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

Inherited Functions

configure

open fun configure(block: Options.() -> Unit): T

Configure socket options in block function