def handle(self):
        while True:
            chunk = self.connection.recv(4)
            if len(chunk) < 4:
                break
            slen = struct.unpack('>L', chunk)[0]
            chunk = self.connection.recv(slen)
            while len(chunk) < slen:
                chunk = chunk + self.connection.recv(slen - len(chunk))

            # unpickle
            obj = pickle.loads(chunk)

            # log the record
            record = logging.makeLogRecord(obj)
            self.log_record(record)
Disable ping on every operation.
dataset/ETHPy150Open rspivak/cynic/cynic/handlers/log.py/LogRecordHandler.handle--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/storage/speckle/python/django/backend/base.py/DatabaseWrapper._valid_connection