Package-level declarations
Types
A CoAP endpoint: the messaging layers and the exchange layer that matches responses to requests by peer and token. dev.kcoap.coap.client.CoapClient and dev.kcoap.coap.server.CoapServer are built on it and can share one endpoint, so a device can be client and server on the same port.
How a CoapEndpoint runs its messaging layers.
A CoAP exchange that could not complete because of the peer, the network, message security or the endpoint itself: no acknowledgement or a Reset over datagrams, a secure session or connection that ended, a response that violates the protocol or could not be verified, a request that message security could not protect, a host that could not be resolved, or an endpoint that is closed, has no transport for the peer, or whose transport failed. reason says which; the reasons of one transport shape say so. This is the one exception type that CoapClient, CoapEndpoint and CoapServer calls fail with at runtime, a KcoapException like the exceptions of kcoap's other protocols; IllegalArgumentException and IllegalStateException are kept for mistakes of the caller, such as a malformed URI string.
Something that happened on a CoapEndpoint, for metrics and diagnostics. Messages themselves are seen through a MessageInterceptor; events cover what has no message of its own.
Receives EndpointEvents. Called synchronously on the endpoint's coroutines, outside its locks, so it must be quick and must not throw; exceptions are caught and logged. Hand the work to a queue or count with atomics; for several listeners, combine them with plus.
How much a CoapEndpoint holds at the moment CoapEndpoint.stats was called, for gauges in metrics and for diagnostics; set each against the bound of CoapEndpointConfig it names. Every value is a count of what is held now, not of what happened: count what happened from EndpointEvents, such as EndpointEvent.RequestCompleted and EndpointEvent.LimitReached.
Sees, and may change or drop, every message at the wire: after OSCORE protection on the way out, before deduplication and OSCORE verification on the way in. Use it for tracing, metrics or fault injection.
How a CoapEndpoint runs CoAP over reliable transports (RFC 8323): what its Capabilities and Settings Message announces, and how it manages connections, which RFC 8323 §3 leaves to the implementation.
Chooses tokens for new requests (RFC 7252 §5.3.1). The endpoint asks again when a token is already in use towards the same peer, so a generator only needs to make collisions unlikely.
The CoAP transmission parameters of RFC 7252 §4.8 and the time values derived from them (§4.8.2).
Functions
The CoapEndpointConfig that block sets up on a CoapEndpointConfig.Builder; what is not set keeps its default:
Sends each event to this listener and then to other, as LogSink.plus does for log records. A listener that throws does not keep the event from the others: each is called, and the first exception is thrown afterwards, for the endpoint to log. EndpointEventListener.None adds nothing.