aiocoap.resourcedirectory.client.register module

Client components for registering with a resource-directory server

class aiocoap.resourcedirectory.client.register.Registerer(context, rd=None, lt=90000, name_from_hostname=None, link_source=None, registration_parameters={}, loggername='coap-rd-registerer')

Bases: object

Implementation of the client side of the registration of a resource directory. Until the object is shut down, it keeps the registration alive. It works both for registering the own context as well as for registering others (taking the role of a commissioning tool).

The state attribute is kept up to date with an informal representation of whether the registration is currently active.

If any step in the registration fails, the object will not retry indefinitely, and it will back off to earlier steps; after a limited number of retries after the last successful step, the object permanently enters a failed state. (In future extension, it might listen for external events that allow it to restart heuristics, like a new network interface coming up).

The registration does not observe the resource list of the registered host (yet?), so registrations are only kept alive and never updated.

async shutdown()

Delete the registration. This will not raise any resulting error messages but just log them, same as any errors occurring during the registration will only be logged.