libcoap icon indicating copy to clipboard operation
libcoap copied to clipboard

Listing current observers on a resource

Open mikefoxTB opened this issue 1 year ago • 2 comments

Is it possible to get a list of observers for a given server resource? I'd like to know if the observer has acked confirmable notifications, current waiting time for ack etc., with enough information to prune the observer from the server based on lack of confirmations.

mikefoxTB avatar May 10 '23 18:05 mikefoxTB

The resource and subscription are opaque structures to an application, and so an additional libcoap function would need to be created to get the sort of information you are looking for.

However, if the unsolicited responses from the server are confirmable, and there is no ACK response from the client for the (default) 4 retransmissions with exponentially increasing re-transmit times (default overall for all 4 retransmissions is 90 seconds), the CoAP response times out and the observe subscription is automatically deleted/pruned. Is this just what you need?

If you want to count active observe subscriptions, then you may be able to use coap_persist_track_funcs(3)

mrdeep1 avatar May 10 '23 20:05 mrdeep1

@mikefoxTB Do you need any more help here?

mrdeep1 avatar Jul 10 '24 16:07 mrdeep1