def METHOD_NAME(sock):
    total_data = []
    while True:
        data = sock.recv(1024).decode()
        if not data:
            break
        total_data.append(data)
    return ''.join(total_data)