handlers.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:board-games-app 作者: sampathweb 项目源码 文件源码
def send_message(self, action, **data):
        """Sends the message to the connected client
        """
        message = {
            "action": action,
            "data": data
        }
        try:
            self.write_message(json.dumps(message))
        except WebSocketClosedError:
            logger.warning("WS_CLOSED", "Could Not send Message: " + json.dumps(message))
            # Send Websocket Closed Error to Paired Opponent
            self.send_pair_message(action="pair-closed")
            self.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号