RequestCompleted

class RequestCompleted(val peer: Endpoint, val method: CoapCode, val resourcePath: String?, val responseCode: CoapCode?, val isSuppressed: Boolean, val securityIdentity: SecurityIdentity?, val duration: Duration) : EndpointEvent(source)

A CoapServer finished a request from peer: one event per request message, each block of a Block1 or Q-Block1 body included, also for a request that message security rejected or challenged, so it counts OSCORE traffic, whose outer codes are all a MessageInterceptor sees.

Every field is bounded, fit for a metric's labels: method and responseCode are the inner codes, as the resource saw them (the outer method on the wire for a request message security could not read), and resourcePath is the path in the resource tree of the resource the request named, never the Uri-Path the client sent, and null when none exists (a 4.04), when message security rejected the request before its path could be read, or when it answered a verified request with a freshness challenge instead of passing it on (RFC 8613 Appendix B.1.2), which no resource saw.

Constructors

Link copied to clipboard
constructor(peer: Endpoint, method: CoapCode, resourcePath: String?, responseCode: CoapCode?, isSuppressed: Boolean, securityIdentity: SecurityIdentity?, duration: Duration)

Properties

Link copied to clipboard

from when the server started on the request to when its response went to the link, on the endpoint's TimeSource.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val peer: Endpoint

The peer the event concerns.

Link copied to clipboard
Link copied to clipboard

the code of the response the server sent, or with isSuppressed the one it left out because the client asked for no such response (No-Response, RFC 7967 §2). Null when the request got no response of its own: a Non-confirmable one rejected for an unrecognized critical option (RFC 7252 §5.4.1), a block in the middle of a Q-Block1 set (RFC 9177 §4.3), or a response a bound of the endpoint refused.

Link copied to clipboard

who message security authenticated, or null for a request without it.

Functions

Link copied to clipboard
open override fun toString(): String