diff options
author | Ivan Davydov <lotigara@lotigara.ru> | 2025-06-29 00:08:38 +0300 |
---|---|---|
committer | Ivan Davydov <lotigara@lotigara.ru> | 2025-06-29 00:08:38 +0300 |
commit | 11714ed6c9adc5b6f90bffa1b23d5bb5b2e20bd5 (patch) | |
tree | 9d1831871da0f1906f01cade4440206b6f0f9b84 /client.py | |
parent | 2cc696105d9f3b8785d2a903211e8adbd707a3e3 (diff) |
Diffstat (limited to 'client.py')
-rwxr-xr-x | client.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 |