def _recv_len(self):
    n = 0
    sh = 0
    while 1:
        b = self.sock.read(1)[0]
        n |= ((b & 127) << sh)
        if (not (b & 128)):
            return n
        sh += 7
def _recv_len(self):
    n = 0
    sh = 0
    while 1:
        b = self.sock.read(1)[0]
        n |= ((b & 127) << sh)
        if (not (b & 128)):
            return n
        sh += 7