本文整理汇总了Python中Messages.parseMsg方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.parseMsg方法的具体用法?Python Messages.parseMsg怎么用?Python Messages.parseMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages.parseMsg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle
# 需要导入模块: import Messages [as 别名]
# 或者: from Messages import parseMsg [as 别名]
def handle(self):
print "Connection from Proxy: " #+ self.proxy_ip
self.location_ip = Location_IP
self.location_port = LocationSendPort
self.location_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
recvMessage = self.request.recv(1024)
if(Messages.checkRegister(recvMessage) == True):
regMsg = Messages.parseMsg(recvMessage)
print regMsg
self.location_sock.connect((self.location_ip, self.location_port))
print "Connect with location"
self.location_sock.send(regMsg)
print "Sending location register id"
response = self.location_sock.recv(1024)
print "Recv from location: " + response
self.location_sock.close()
print "Close Connection with location"
self.request.send("OK")
print "Send OK to proxy"