def read_response(self):
        packet = read_packet(self._connfd)
        if packet.header.ptype != CCNET_MSG_RESPONSE:
            raise RuntimeError('Invalid Response')

        code, code_msg, content = parse_response(packet.body)

        return Response(code, code_msg, content)
Exemple #2
0
    def read_response(self):
        packet = read_packet(self._connfd)
        if packet.header.ptype != CCNET_MSG_RESPONSE:
            raise RuntimeError('Invalid Response')

        code, code_msg, content = parse_response(packet.body)

        return Response(code, code_msg, content)
Exemple #3
0
 def main_loop(self):
     while True:
         pkt = read_packet(self._connfd)
         import gevent
         gevent.spawn(self.handle_packet, pkt)
 def main_loop(self):
     while True:
         pkt = read_packet(self._connfd)
         import gevent
         gevent.spawn(self.handle_packet, pkt)