def METHOD_NAME(tcp_server_pipe, last_message="Client disconnected", timeout=5):
    start_time = time.time()
    dialog_with_server = []
    while last_message not in dialog_with_server:
        tcp_server_pipe.send(("get history", {}))
        time.sleep(0.01)
        dialog_with_server = tcp_server_pipe.recv()
        if time.time() - start_time > timeout:
            break
    return dialog_with_server