This commit is contained in:
macbook-pro 2023-12-18 05:24:34 +08:00
parent 3d6081735f
commit 3b48749414
4 changed files with 11 additions and 5 deletions

BIN
c

Binary file not shown.

8
cli.py
View File

@ -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'))

BIN
s

Binary file not shown.

8
ser.py
View File

@ -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()