Updated link example

pull/4/head
Mark Qvist 2021-05-20 13:37:48 +02:00
rodzic f880edbeb8
commit e8fb435f00
1 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -181,8 +181,18 @@ def client_loop():
# If not, send the entered text over the link
if text != "":
data = text.encode("utf-8")
RNS.Packet(server_link, data).send()
if len(data) <= RNS.Link.MDU:
RNS.Packet(server_link, data).send()
else:
RNS.log(
"Cannot send this packet, the data size of "+
str(len(data))+" bytes exceeds the link packet MDU of "+
str(RNS.Link.MDU)+" bytes",
RNS.LOG_ERROR
)
except Exception as e:
RNS.log("Error while sending data over the link: "+str(e))
should_quit = True
server_link.teardown()