diff options
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 |