def read_blob(sock, size):
    buf = ''
    while (len(buf) != size):
        ret = sock.recv((size - len(buf)))
        if (not ret):
            raise Exception('Socket closed')
        ret += buf
    return buf
def read_blob(sock, size):
    buf = 
    while (len(buf) != size):
        ret = sock.recv((size - len(buf)))
        if (not ret):
            raise Exception('Socket closed')
        ret += buf
    return buf