KnutWebSocket¶
-
class
knut.server.websocket.KnutWebSocket(address: str, port: int)¶ WebSocket for Knut.
Bind to the address and listen on the port for requests.
-
knut_serve_forever()¶ The main event loop of the server.
Warning
Must be implemented by a subclass.
-
request_service(apiid: int, msgid: int, msg: dict) → Tuple[int, dict]¶ Return a service’s response.
Call the
request_handler()of the API with the apiid. The API’s request handler handles then the msg of type msgid. Return a tuple that holds the responses msgid and msg. If no API for apiid is found in the servers API dictionary, the msg and msgid is returned.
-