Files
libcoap/include
Richard Retanubun e1d33fd7c9 resource.c: Add COAP_RESOURCE_MAX_SUBSCRIBER to limit subscribers
If COAP_RESOURCE_MAX_SUBSCRIBER is > 0
coap_add_observer() now checks and returns NULL
if COAP_RESOURCE_MAX_SUBSCRIBER is exceeded.

net.c then detects this and respond.

Per RFC7641 4.1. Request:

  A server that is unable or unwilling to add a new entry to the list
  of observers of a resource MAY silently ignore the registration
  request and process the GET request as usual.  The resulting response
  MUST NOT include an Observe Option, the absence of which signals to
  the client that it will not be notified of changes to the resource
  and, e.g., needs to poll the resource for its state instead.

Useful for constrained systems that wants to support
observers but need to be mindful of memory usage.
2022-12-26 11:19:21 +00:00
..