Пример #1
0
    def send_ws_msg(self, msg: CommonMSG) -> None:
        """Send a command to the web client over websocket in a standard JSON format.

        Args:
           msg: the message to send.
        """
        if self.ws is not None:
            self.ws.sendMSG(msg.as_dict())
Пример #2
0
 def send_WS_msg(self, msg: CommonMSG) -> None:
     """Send a message to the server via websocket."""
     if self.is_WS_up():
         self._server_ws.send(msg.as_dict())
     else:
         print("SEND IS NOOOT HAPPENING")