python中使用anyio来实现异步tcp服务端和客户端
服务端代码from anyio import create_tcp_listener, run#tcp服务端代码,async def handle(client): async with client: print("客户端",client) name = await client.receive(1024) await client.send(b'Hello, %s\n' % name)async def main(): lis
原创
2021-10-22 00:50:14 ·
3718 阅读 ·
0 评论