use ggg
This commit is contained in:
parent
3d6081735f
commit
3b48749414
8
cli.py
8
cli.py
@ -18,7 +18,11 @@ s.connect((host, port))
|
|||||||
|
|
||||||
tex = "this is test"
|
tex = "this is test"
|
||||||
s.send(tex.encode('utf-8'))
|
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()
|
s.close()
|
||||||
|
|
||||||
print (msg.decode('utf-8'))
|
|
||||||
|
8
ser.py
8
ser.py
@ -19,7 +19,9 @@ serversocket.listen(5)
|
|||||||
while True:
|
while True:
|
||||||
clientsocket,addr = serversocket.accept()
|
clientsocket,addr = serversocket.accept()
|
||||||
print("连接地址: %s" % str(addr))
|
print("连接地址: %s" % str(addr))
|
||||||
masg='欢迎访问菜鸟教程!'+ "\r\n"
|
msg1 = clientsocket.recv(1024)
|
||||||
msg = clientsocket.recv(1024)
|
clientsocket.send(msg1)
|
||||||
clientsocket.send(msg)
|
msg2 = clientsocket.recv(1024)
|
||||||
|
clientsocket.send(msg2)
|
||||||
|
|
||||||
clientsocket.close()
|
clientsocket.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user