mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
update examples/socket/server_client.py.
Signed-off-by: 李昂 <liang6516@outlook.com>
This commit is contained in:
parent
6eec732fb5
commit
78aba92e01
@ -17,13 +17,13 @@ res = server.accept()
|
||||
accept = res[0]
|
||||
addr = res[1]
|
||||
|
||||
print("recv from client: %s" % str(addr))
|
||||
print("recv from client: %s" % str(addr))
|
||||
|
||||
client.send(String("send test from client").encode())
|
||||
print("server recv:", ByteArray(accept.recv(1024)).decode())
|
||||
print("server recv:", ByteArray(accept.recv(1024)).decode())
|
||||
|
||||
accept.send(String("send test from server").encode())
|
||||
print("client recv:", ByteArray(client.recv(1024)).decode())
|
||||
print("client recv:", ByteArray(client.recv(1024)).decode())
|
||||
|
||||
accept.close()
|
||||
client.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user