Ejemplo n.º 1
0
 def recv_frame(self, frame):
     try:
         for l in frame.split(";"):
             c = l[:1]
             if (c == 'e'):
                 self.recv_event(parse_event(l + ";")[0])
             elif (c == 's'):
                 self.recv_status(parse_status(l + ";")[0])
             elif (c == 'c'):
                 parse_string(l, "close")
                 self.recv_close()
             elif (l != ""):
                 raise (RuntimeError())
     except:
         logger.error("bad frame: " + frame)
         logger.exception()
         self.transport.loseConnection()
Ejemplo n.º 2
0
 def recv_frame(self, frame):
     try:
         for l in frame.split(";"):
             c = l[:1]
             if (c == 'e'):
                 self.recv_event(parse_event(l + ";")[0])
             elif (c == 's'):
                 self.recv_status(parse_status(l + ";")[0])
             elif (c == 'c'):
                 parse_string(l, "close")
                 self.recv_close()
             elif (l != ""):
                 raise(RuntimeError())
     except:
         logger.error("bad frame: " + frame)
         logger.exception()
         self.transport.loseConnection()
Ejemplo n.º 3
0
 def recv_metrics(self, metrics):
     logger.debug("recv_metrics: %d" % len(metrics))
     try:
         self.relay.relay(metrics)
     except:
         logger.error("cant relay to peer address")