From f3b195b41e9ca89ccf9e4accfdf8dc452d279649 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 25 Apr 2018 11:43:06 +0200 Subject: [PATCH] Updated Echo example --- Examples/Echo.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Examples/Echo.py b/Examples/Echo.py index f55893b..452cfbe 100644 --- a/Examples/Echo.py +++ b/Examples/Echo.py @@ -163,14 +163,15 @@ def packet_timed_out(receipt): if receipt.status == RNS.PacketReceipt.FAILED: RNS.log("Packet "+RNS.prettyhexrep(receipt.hash)+" timed out") +# This part of the program gets run at startup, +# and parses input of from the user, and then +# starts up the desired program mode. if __name__ == "__main__": - # Set up command line arguments and start - # the selected program mode. try: parser = argparse.ArgumentParser(description="Simple echo server and client utility") parser.add_argument("-s", "--server", action="store_true", help="wait for incoming packets from clients") - parser.add_argument("--config", action="store", default=None, help="path to alternative Reticulum config directory", type=str) parser.add_argument("-t", "--timeout", action="store", metavar="s", default=None, help="set a reply timeout in seconds", type=float) + parser.add_argument("--config", action="store", default=None, help="path to alternative Reticulum config directory", type=str) parser.add_argument("destination", nargs="?", default=None, help="hexadecimal hash of the server destination", type=str) args = parser.parse_args()