代码拉取完成,页面将自动刷新
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
import socket
import threading
import socketserver
import json
if __name__ == "__main__":
# Port 0 means to select an arbitrary unused port
# msg1 = [{'src':"zj", 'dst':"zjdst"}]
# msg2 = [{'src':"ln", 'dst':"lndst"}]
# msg3 = [{'src':"xj", 'dst':"xjdst"}]
# jmsg1 = json.dumps(msg1)
# jmsg2 = json.dumps(msg2)
# jmsg3 = json.dumps(msg3)
# client(HOST, PORT, jmsg1)
# client(HOST, PORT, jmsg2)
# client(HOST, PORT, jmsg3)
# for i in range(10000):
HOST, PORT = "localhost", 20001
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((HOST, PORT))
msg = [{
"request": 1
}]
jmsg = json.dumps(msg)
sock.sendall(jmsg.encode("utf-8"))
sock.sendall(jmsg.encode("utf-8"))
sock.close()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。