代码拉取完成,页面将自动刷新
同步操作将从 郑一天/tcp_over_udp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import socket,select
from helpFunc import *
import uuid,json
mySalt = serviceSaltKey.encode()
from connClient import connClient
id = str(uuid.uuid1())
ports2 = []
gSalt = b''
salt_str = randomStringDigits()
while True:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
m = {'sign':id}
m['rate'] = con_minRate
m['pushAhead'] = con_pushAhead
m['packLimit'] = con_packLimit
m['salt'] = salt_str
gSalt = m['salt'].encode()
m['num'] = maxPortNum
j = json.dumps(m)
j = j.encode()
u ,s2 = makePack(j,mySalt)
sock.sendto(s2, (con_serverIp, servicePort))
r = select.select([sock],[],[],timeoutTime)
if r[0]==[]:
sock.close()
continue
j = sock.recv(recLen)
s2 = checkPackValid(j,u,mySalt)
if not s2:
sock.close()
continue
ports = []
st = structWrapper(s2)
for i in range(maxPortNum):
ports.append(st.readWord())
print ('server starts:',ports)
ports2 = ports
sock.close()
break
import time
from tornado.ioloop import IOLoop
serverListenPort = ports2
rate = con_minRate
pushAhead = con_pushAhead
packLimit = con_packLimit
salt = gSalt
clientListenIp = '0.0.0.0'
clientListenPort = 9999
time.sleep(1)
t = connClient(serverListenPort,salt,rate,pushAhead,packLimit,clientListenIp,clientListenPort)
IOLoop.instance().start()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。