Struct coap_lite::block_handler::BlockHandlerConfig
source · pub struct BlockHandlerConfig {
pub max_total_message_size: usize,
pub cache_expiry_duration: Duration,
}
Expand description
The configuration for BlockHandler
.
Fields§
§max_total_message_size: usize
Total framed message size to offer to the peer (packet size minus transport overhead). In an ideal world this would be computed based on the endpoint MTU or even part of a more structured Endpoint API but we’re pretty far off from that today. Just make it configurable then.
Note this is not the suggested block size as that is referring only to the payload body. Because we have dynamic overhead for the CoAP message itself (for example if we add more options), we need to dynamically tune this to meet the physical requirements of the link rather than just some arbitrary limiting of the payload block size.
cache_expiry_duration: Duration
Length of time without interaction for cached responses to live (bumped each time the client requests some portion of the response).