keepalive: Add in server keepalive support

If coap_context_set_keepalive() is set in the server, CoAP keepalive packets
will get sent for any CoAP session that is curently observing a resource.

If the keepalive times out, then the observation(s) are canceled and the
server session is deleted.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2025-01-10 10:44:20 +00:00
1 parent 080da9a843
commit 4d84859620
8 files changed
+83 -12

No files matched your search

+1
View File
@@ -2563,6 +2563,7 @@ main(int argc, char **argv) {
coap_mcast_per_resource(ctx);
coap_context_set_block_mode(ctx, block_mode);
coap_context_set_max_block_size(ctx, max_block_size);
coap_context_set_keepalive(ctx, 30);
if (csm_max_message_size)
coap_context_set_csm_max_message_size(ctx, csm_max_message_size);
if (doing_tls_engine) {