mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-05-03 23:24:59 -04:00
Buffer: send and receive binary data over Channel
(also some minor fixes in channel)
This commit is contained in:
parent
58004d7c05
commit
aac2b9f987
8 changed files with 835 additions and 13 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue