def _on_recv(self, conn_id, buf):
        recv_buffer = self._connections[conn_id].recv_buffer
        recv_buffer.put(buf)
        try:
            packets = recv_buffer.get_packets()
        except SnakeMQBrokenPacket as exc:
            self.log.error("conn=%s %r" % (conn_id, exc))
            self.on_error(conn_id, exc)
            self.link.close(conn_id)
            return

        for packet in packets:
            self.log.debug("recv packet %s len=%i" % (conn_id, len(packet)))
            self.on_packet_recv(conn_id, packet)

    ###########################################################
dataset/ETHPy150Open dsiroky/snakemq/snakemq/packeter.py/Packeter._on_recv/original