class documentation

class ACMECoAPServer(CoAP):

Constructor: ACMECoAPServer(host, port)

View In Hierarchy

ACME CoAP Server.

It is used to setup the CoAPthon library to handle CoAP requests according to the ACME CSE requirements. It also provides functionality to send CoAP requests to other CoAP servers.

Class CoapLoggingHandler A logging handler for redirecting the CoAPthon logging to the ACME logging.
Method __init__ Initialize the ACME CoAP Server.
Method run Run the CoAP Server.
Method sendRequest Send a CoAP request to a URL.
Method stop Stop the CoAP Server.
Class Variable __slots__ Slots of the ACME CoAP Server.
Instance Variable clientCache A cache for outgoing client connections.
Method _handleListenException Handle a listen exception.
Instance Variable _isPaused Flag whether the server is paused. If the server is paused, it will not handle any requests and return an error.
Instance Variable _requestHandler The request handler to handle requests.
Instance Variable _requestLayer The request layer to handle requests instead of resources.
def __init__(self, host: str, port: int):

Initialize the ACME CoAP Server.

Parameters
host:strThe host to bind the CoAP server to.
port:intThe port to bind the CoAP server to.
def run(self):

Run the CoAP Server.

def sendRequest(self, request: CSERequest, url: str, ignoreResponse: bool = False) -> Result:

Send a CoAP request to a URL.

Parameters
request:CSERequestThe request to send.
url:strThe URL to send the request to.
ignoreResponse:boolFlag whether to ignore the response.
Returns
ResultThe result of the request.
def stop(self):

Stop the CoAP Server.

__slots__: tuple[str, ...] =

Slots of the ACME CoAP Server.

clientCache: ACMELRUCache =

A cache for outgoing client connections.

def _handleListenException(self, e: Exception, coapServer: CoAP) -> bool:

Handle a listen exception.

Parameters
e:ExceptionThe exception.
coapServer:CoAPThe CoAP server.
Returns
boolTrue if the exception was handled, False otherwise.
_isPaused: bool =

Flag whether the server is paused. If the server is paused, it will not handle any requests and return an error.

_requestHandler =

The request handler to handle requests.

_requestLayer =

The request layer to handle requests instead of resources.