Buffer: send and receive binary data over Channel

(also some minor fixes in channel)
This commit is contained in:
Aaron Heise 2023-03-02 17:13:55 -06:00
parent 58004d7c05
commit aac2b9f987
No known key found for this signature in database
GPG key ID: 6BA54088C41DE8BF
8 changed files with 835 additions and 13 deletions

View file

@ -243,11 +243,6 @@ def client(destination_hexhash, configpath):
# And create a link
link = RNS.Link(server_destination)
# We set a callback that will get executed
# every time a packet is received over the
# link
link.set_packet_callback(client_message_received)
# We'll also set up functions to inform the
# user when the link is established or closed
link.set_link_established_callback(link_established)
@ -330,7 +325,7 @@ def link_closed(link):
time.sleep(1.5)
os._exit(0)
# When a packet is received over the link, we
# When a packet is received over the channel, we
# simply print out the data.
def client_message_received(message):
if isinstance(message, StringMessage):
@ -348,7 +343,7 @@ def client_message_received(message):
# starts up the desired program mode.
if __name__ == "__main__":
try:
parser = argparse.ArgumentParser(description="Simple link example")
parser = argparse.ArgumentParser(description="Simple channel example")
parser.add_argument(
"-s",