diff --git a/c b/c deleted file mode 100755 index 4668f58..0000000 Binary files a/c and /dev/null differ diff --git a/cli.py b/cli.py index e48c767..da60930 100644 --- a/cli.py +++ b/cli.py @@ -18,7 +18,11 @@ s.connect((host, port)) tex = "this is test" s.send(tex.encode('utf-8')) -msg = s.recv(1024) +msg1 = s.recv(1024) +print (msg1.decode('utf-8')) +s.send(tex.encode('utf-8')) +msg2 = s.recv(1024) +print (msg2.decode('utf-8')) s.close() -print (msg.decode('utf-8')) + diff --git a/s b/s deleted file mode 100755 index 61fd444..0000000 Binary files a/s and /dev/null differ diff --git a/ser.py b/ser.py index 92cc8d8..dca6c87 100644 --- a/ser.py +++ b/ser.py @@ -19,7 +19,9 @@ serversocket.listen(5) while True: clientsocket,addr = serversocket.accept() print("连接地址: %s" % str(addr)) - masg='欢迎访问菜鸟教程!'+ "\r\n" - msg = clientsocket.recv(1024) - clientsocket.send(msg) + msg1 = clientsocket.recv(1024) + clientsocket.send(msg1) + msg2 = clientsocket.recv(1024) + clientsocket.send(msg2) + clientsocket.close()