mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-06 17:52:54 +03:00
examples/coap-server.c: Track time spent in the epoll branch for the select() and coap_io_process() calls to correctly adjust wait_ms. Adjust wait_ms to be the remaining amount in the current second, so that any 'time' observers get the updated time just after the new second starts. include/coap2/net.h: Add in support to track that an observe is pending transmission - primarily a saving of needing to look up if a observe needs to be sent. include/coap2/resource.h: Add in support to track the context that 'owns' a resource. src/resource.c: Track the context that 'owns' a resource in coap_add_resource(). Track the fact that when we are making a resource partially dirty by recording that an observe is pending in coap_notify_observers(). In the epoll case, make sure that timerfd triggers immediately when a pending observe is set so that the application will return immediately from any select() etc. call to process the libcoap outstanding activity (in particular pending observes) in coap_resource_notify_observers(). Only call coap_notify_observers() in coap_check_notify if there are any observes pending. man/coap_observe.txt.in: Minor clarifications in the examples.