在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mdebbar/jsonsocket开源软件地址:https://github.com/mdebbar/jsonsocket开源编程语言:开源软件介绍:jsonsocketThis is a small Python library for sending data over sockets. It allows sending lists, dictionaries, strings, etc. It can handle very large data (I've tested it with 10GB of data). Any JSON-serializable data is accepted. Examples: from jsonsocket import Client, Server
host = 'localhost'
port = '8000'
# Client code:
client = Client()
client.connect(host, port).send({'some_list': [123, 456]})
response = client.recv()
# response now is {'data': {'some_list': [123, 456]}}
client.close()
# Server code:
server = Server(host, port)
server.accept()
data = server.recv()
# data now is: {'some_list': [123, 456]}
server.send({'data': data}).close() |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论