Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'client.py')
-rwxr-xr-xclient.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/client.py b/client.py
index 26548c2..0c0fcfc 100755
--- a/client.py
+++ b/client.py
@@ -15,13 +15,14 @@ except FileNotFoundError as e:
exit(e)
if len(argv) >= 3 and argv[2]:
- msg = argv[2].encode("ascii")
+ cmd = argv[2].encode("ascii")
else:
- msg = b"hello, world!"
+ cmd = b"hello"
# 1 char in Python is 2 bytes instead of 1 byte in C
-#msg_len = acccre_size(getsizeof(msg))
-msg_len = acccre_size(2)
-sun.send(msg_len)
-sun.send(msg)
+cmd += b"\tserver\tworld\thello"
+cmd_len = acccre_size(getsizeof(cmd))
+sun.send(cmd_len)
+sun.send(cmd)
+print(str(sun.recv(5)))
sun.close