aiocoap.transports.rfc8323common module

Common code for the tcp and the ws modules, both of which are based on RFC8323 mechanisms, but differ in their underlying protocol implementations (asyncio stream vs. websockets module) far enough that they only share small portions of their code

exception aiocoap.transports.rfc8323common.CloseConnection

Bases: Exception

Raised in RFC8323 common processing to trigger a connection shutdown on the TCP / WebSocket side.

The TCP / WebSocket side should send the exception’s argument on to the token manager, close the connection, and does not need to perform further logging.

class aiocoap.transports.rfc8323common.RFC8323Remote

Bases: object

Mixin for Remotes for all the common RFC8323 processing

Implementations still need the per-transport parts, especially a _send_message and an _abort_with implementation.

is_multicast = False
is_multicast_locally = False
hostinfo
hostinfo_local
uri_base
uri_base_local
maximum_block_size_exp
maximum_payload_size
blockwise_key
abort(errormessage=None, bad_csm_option=None)
release()

Send Release message, (not implemented:) wait for connection to be actually closed by the peer.

Subclasses should extend this to await closing of the connection, especially if they’d get into lock-up states otherwise (was would WebSockets).