CoapClient

constructor(endpoint: CoapEndpoint, config: CoapClientConfig = CoapClientConfig.Default)(source)

A client on an existing endpoint, which a dev.kcoap.coap.server.CoapServer may share.


constructor(transport: DatagramTransport, scope: CoroutineScope, config: CoapClientConfig = CoapClientConfig.Default, endpointConfig: CoapEndpointConfig = CoapEndpointConfig.Default)(source)

A client on a new endpoint over transport; close closes both.


constructor(connectors: List<Connector>, scope: CoroutineScope, config: CoapClientConfig = CoapClientConfig.Default, endpointConfig: CoapEndpointConfig = CoapEndpointConfig.Default)(source)

A client for CoAP over reliable transports (RFC 8323) on a new endpoint: requests to coap+tcp, coaps+tcp, coap+ws or coaps+ws URIs open connections through connectors, reuse them per peer and release them when idle (dev.kcoap.coap.stack.ReliableTransportConfig.idleTimeout). close closes the endpoint and its connections.