ReliableTransportConfig

class ReliableTransportConfig(val maxMessageSize: Long = DEFAULT_MAX_MESSAGE_SIZE, val blockWiseTransfer: Boolean = true, val csmTimeout: Duration = 10.seconds, val connectTimeout: Duration = 30.seconds, val idleTimeout: Duration? = 30.seconds, val releaseTimeout: Duration = 5.seconds, val pingTimeout: Duration = 30.seconds, val keepAliveInterval: Duration? = null, val maxPendingConnections: Int = DEFAULT_MAX_PENDING_CONNECTIONS, val maxConnections: Int = DEFAULT_MAX_CONNECTIONS)(source)

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.

Constructors

Link copied to clipboard
constructor(maxMessageSize: Long = DEFAULT_MAX_MESSAGE_SIZE, blockWiseTransfer: Boolean = true, csmTimeout: Duration = 10.seconds, connectTimeout: Duration = 30.seconds, idleTimeout: Duration? = 30.seconds, releaseTimeout: Duration = 5.seconds, pingTimeout: Duration = 30.seconds, keepAliveInterval: Duration? = null, maxPendingConnections: Int = DEFAULT_MAX_PENDING_CONNECTIONS, maxConnections: Int = DEFAULT_MAX_CONNECTIONS)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Whether the CSM announces BERT: Block-Wise-Transfer with a Max-Message-Size above 1152 (§5.3.2).

Link copied to clipboard

whether the CSM carries Block-Wise-Transfer (§5.3.2). The stack implements RFC 7959 and BERT, so it is on by default.

Link copied to clipboard

how long opening a connection may take, transport and TLS or WebSocket handshakes included.

Link copied to clipboard

how long to wait for the peer's CSM, which MUST be its first message; without one the connection is aborted (§3.3). A client sends its first request once the CSM is there, so block sizes follow the peer's Max-Message-Size from the start.

Link copied to clipboard

how long a connection this endpoint opened stays open without exchanges, pending requests or traffic before the endpoint releases it (§5.5), the dynamic connection management of §3; null keeps it open. Accepted connections are left to the peer that opened them.

Link copied to clipboard

send a Ping after this long without receiving anything, and abort the connection when nothing arrives within pingTimeout after it (§3.4, §4.4). Null disables it.

Link copied to clipboard

the most connections the endpoint keeps at once, those it opened and those it accepted. Each holds a reader, a writer, timers and buffers, and every source port is a peer of its own, so an accepted connection beyond it is closed at once and reported as EndpointEvent.LimitReached, however it got past maxPendingConnections. Connections this endpoint opens are not refused.

Link copied to clipboard

the largest message this endpoint receives, announced as Max-Message-Size in its CSM (§5.3.1) and enforced: a larger message aborts the connection (§5.6). Above 1152, together with blockWiseTransfer, it also announces BERT (§5.3.2). The default follows the §5.3.2 implementation note: 8 KiB BERT blocks plus 512 bytes for header and options.

Link copied to clipboard

the most accepted connections whose peer has not sent its CSM yet (§3.3), each held for at most csmTimeout. A connection beyond it is closed at once and reported as EndpointEvent.LimitReached, so peers that connect and never speak cannot exhaust memory, as RFC 7252 §11.3 asks of any state an unauthenticated peer can create. Established connections do not count.

Link copied to clipboard

how long a Ping waits for its Pong, which §5.4 leaves to the application; it bounds CoapEndpoint.ping and keep-alive pings.

Link copied to clipboard

after sending a Release, how long to wait for the peer to close before closing anyway; after receiving one, how long to wait for pending requests to be answered and own requests to be answered before closing (§5.5).

Functions

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