mirror of
https://github.com/markqvist/Reticulum.git
synced 2026-06-15 09:03:37 -07:00
Buffer: send and receive binary data over Channel
(also some minor fixes in channel)
This commit is contained in:
+2
-7
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user