本文整理汇总了Python中message.Message.deserialize方法的典型用法代码示例。如果您正苦于以下问题:Python Message.deserialize方法的具体用法?Python Message.deserialize怎么用?Python Message.deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message.Message
的用法示例。
在下文中一共展示了Message.deserialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _gnutella
# 需要导入模块: from message import Message [as 别名]
# 或者: from message.Message import deserialize [as 别名]
def _gnutella(self):
try:
while True:
msg = Message()
msg_length = msg.deserialize(self.received_data)
if msg_length:
self.received_data = self.received_data[msg_length:]
self.reactor.servent.on_receive(self, msg)
else:
break
except ValueError:
# The message stream is messed up
self.reactor.servent.log("Mesage stream is messed up")
self.handle_close()
示例2: rawDataReceived
# 需要导入模块: from message import Message [as 别名]
# 或者: from message.Message import deserialize [as 别名]
def rawDataReceived(self,data):
msg = Message.deserialize(data)
self.factory.server.handleMsg(self,msg)
示例3: handle_request
# 需要导入模块: from message import Message [as 别名]
# 或者: from message.Message import deserialize [as 别名]
def handle_request(self, conn, received_message):
print received_message
message = Message.deserialize(received_message)
logging.debug('received_message: ', message)