示例#1
0
 def lineReceived(self, line):
     msg = message.parse(line)
     if msg.action == 'update':
         self.factory.update(msg.payload)
     elif msg.action == 'error':
         self.factory.error(msg.payload)
     else:
         log.info('Unexpected message: %s %s', msg.action, msg.payload)
示例#2
0
文件: main.py 项目: yuvalturg/ROSE
 def lineReceived(self, line):
     msg = message.parse(line)
     if msg.action == 'update':
         self.factory.update(msg.payload)
     elif msg.action == 'error':
         self.factory.error(msg.payload)
     else:
         log.info('Unexpected message: %s %s', msg.action, msg.payload)
示例#3
0
 def lineReceived(self, line):
     try:
         msg = message.parse(line)
         self.dispatch(msg)
     except error.Error as e:
         msg = message.Message('error', {'message': str(e)})
         self.sendLine(str(msg))
         self.transport.loseConnection()
示例#4
0
文件: net.py 项目: yuvalturg/ROSE
 def lineReceived(self, line):
     try:
         msg = message.parse(line)
         self.dispatch(msg)
     except error.Error as e:
         log.warning("Error handling message: %s", e)
         msg = message.Message('error', {'message': str(e)})
         self.sendLine(str(msg).encode('utf-8'))
         self.transport.loseConnection()
示例#5
0
 def lineReceived(self, line):
     try:
         msg = message.parse(line)
         self.dispatch(msg)
     except error.Error as e:
         print "Error handling message: %s" % e
         msg = message.Message('error', {'message': str(e)})
         self.sendLine(str(msg))
         self.transport.loseConnection()