From 11714ed6c9adc5b6f90bffa1b23d5bb5b2e20bd5 Mon Sep 17 00:00:00 2001 From: Ivan Davydov Date: Sun, 29 Jun 2025 00:08:38 +0300 Subject: Iuj ŝanĝoj... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'client.py') 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 -- cgit v1.2.3