当前位置: 首页>>代码示例>>Python>>正文


Python WebSocketServerProtocol.sendMessage方法代码示例

本文整理汇总了Python中autobahn.websocket.WebSocketServerProtocol.sendMessage方法的典型用法代码示例。如果您正苦于以下问题:Python WebSocketServerProtocol.sendMessage方法的具体用法?Python WebSocketServerProtocol.sendMessage怎么用?Python WebSocketServerProtocol.sendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在autobahn.websocket.WebSocketServerProtocol的用法示例。


在下文中一共展示了WebSocketServerProtocol.sendMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sendMessage

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import sendMessage [as 别名]
    def sendMessage(self, payload, binary=False):
        if isinstance(payload, dict) and not binary:
            msg = json.dumps(payload)
        else:
            msg = json.dumps({'message': payload})

        WebSocketServerProtocol.sendMessage(self, msg, binary=binary)
开发者ID:alex-laties,项目名称:MMFE,代码行数:9,代码来源:protocol.py

示例2: sendMessage

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import sendMessage [as 别名]
 def sendMessage(self, msg):
     """ This method is called by the User instance to send a message to the
         robot.
         
         @param msg:     Message which should be sent
     """
     uriBinary, msgURI = recursiveBinarySearch(msg)
     
     WebSocketServerProtocol.sendMessage(self, json.dumps(msgURI))
     
     for binData in uriBinary:
         WebSocketServerProtocol.sendMessage(self,
             binData[0] + binData[1].getvalue(), binary=True)
开发者ID:LCROBOT,项目名称:rce,代码行数:15,代码来源:protocol.py

示例3: sendMessage

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import sendMessage [as 别名]
    def sendMessage(self, msg):
        """ Internally used method to send a message to the robot.

            Should not be used from outside the Protocol; instead use the
            methods 'sendDataMessage' or 'sendErrorMessage'.

            (Overwrites method from autobahn.websocket.WebSocketServerProtocol)

            @param msg:     Message which should be sent.
        """
        uriBinary, msgURI = recursiveBinarySearch(msg)

        WebSocketServerProtocol.sendMessage(self, json.dumps(msgURI))

        for binData in uriBinary:
            WebSocketServerProtocol.sendMessage(self,
                binData[0] + binData[1].getvalue(), binary=True)
开发者ID:vmayoral,项目名称:rce,代码行数:19,代码来源:server.py

示例4: sendMessage

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import sendMessage [as 别名]
 def sendMessage(self, msg, binary = False):
   WebSocketServerProtocol.sendMessage(self, msg, binary)
开发者ID:named-data,项目名称:peets,代码行数:4,代码来源:protocol.py

示例5: sendMessage

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import sendMessage [as 别名]
 def sendMessage(self, payload, binary=False, payload_frag_size=None, sync=False):
     self._my_status = SOCKET_STATUS_WAITING # 等待状态
     WebSocketServerProtocol.sendMessage(self, payload, binary, payload_frag_size, sync)
开发者ID:nic562,项目名称:FileUpload,代码行数:5,代码来源:websocket.py


注:本文中的autobahn.websocket.WebSocketServerProtocol.sendMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。