CoapServer
constructor(endpoint: CoapEndpoint, config: CoapServerConfig = CoapServerConfig(), routes: ResourceBuilder.() -> Unit = {})(source)
Serves on an existing endpoint, which a dev.kcoap.coap.client.CoapClient may share.
constructor(transport: DatagramTransport, scope: CoroutineScope, config: CoapServerConfig = CoapServerConfig(), endpointConfig: CoapEndpointConfig = CoapEndpointConfig.Default, routes: ResourceBuilder.() -> Unit = {})(source)
Serves on a new endpoint over transport; close closes both.
constructor(listeners: List<ConnectionListener>, scope: CoroutineScope, config: CoapServerConfig = CoapServerConfig(), endpointConfig: CoapEndpointConfig = CoapEndpointConfig.Default, routes: ResourceBuilder.() -> Unit = {})(source)
Serves CoAP over reliable transports (RFC 8323) on the connections listeners accept, such as TCP and WebSocket listeners, on a new endpoint; close closes it and the listeners.