CoapClientConfig
How a CoapClient sends requests.
Build one with the DSL, CoapClientConfig { requestTimeout = 5.seconds }, or with a Builder (CoapClientConfig.Builder(), set its properties, build()), which reads the same from Swift; Default has every default, and toBuilder starts from an existing configuration. The configuration itself is immutable, and every value is checked when it is built. Options added later go into the builder, so code that builds a configuration keeps compiling, and compiled code keeps linking.
Types
Collects the values of a CoapClientConfig; every property starts at its default, documented on the property of the same name. Not thread safe: build on one thread, then share the configuration.
Properties
The largest body assembled from Block2 transfers.
What a cancelled observation does (RFC 7641 §3.6). Over reliable transports the client always deregisters (RFC 8323 §7.4).
The block size the client prefers, 16..1024: Block1 uploads use it, and setting it turns on early negotiation, so every request without a body proposes it as the Block2 size of the response (RFC 7959 §2.4); a server may still choose smaller blocks. Null, the default, uses the largest size the datagram (or the server's Max-Message-Size, with BERT where both sides indicated it, RFC 8323 §6) fits and lets the server choose the response block size. Set, it also turns BERT off. The server's counterpart is its upper bound CoapServerConfig.maxBlockSize.
Whether and how requests use Q-Block (RFC 9177) instead of RFC 7959; off by default. preferredBlockSize and maxResponseBodySize apply to Q-Block bodies too.
How long to wait for the response to one request (one block), measured from sending; null waits EXCHANGE_LIFETIME. A Confirmable request without ACK fails earlier, after MAX_TRANSMIT_WAIT.
Turns the host of a URI into a transport Endpoint; EndpointResolver.Default takes IP literals for every scheme and passes host names to the connectors of RFC 8323 schemes.
Message security (OSCORE) for outgoing requests, called below block-wise and Observe and above the messaging layer (RFC 8613 Figure 1); null sends requests unprotected.
Bytes kept free in each message for security's overhead when choosing block sizes.