添加数据包序号提示
This commit is contained in:
parent
02a4d37cc3
commit
7d9921b026
17
server.py
17
server.py
@ -221,10 +221,25 @@ def check_valid(data):
|
|||||||
|
|
||||||
return bytearray(data[:])
|
return bytearray(data[:])
|
||||||
|
|
||||||
|
def get_info(data):
|
||||||
|
# print(type(data[12]))
|
||||||
|
o=0
|
||||||
|
def h2s(x):
|
||||||
|
# x= int.from_bytes(x)
|
||||||
|
return str(x)
|
||||||
|
pass
|
||||||
|
sn = "-".join(list(map(h2s,data[12:17])))
|
||||||
|
index=int.from_bytes(data[19:20])
|
||||||
|
cnt=int.from_bytes(data[20:21])
|
||||||
|
t=f"流水号20{sn}:[{index}/{cnt}]"
|
||||||
|
print(t)
|
||||||
|
s2wx("","",t)
|
||||||
|
|
||||||
|
|
||||||
def tt_trans(addr, data):
|
def tt_trans(addr, data):
|
||||||
"""发送数据到指定ccid"""
|
"""发送数据到指定ccid"""
|
||||||
|
|
||||||
|
get_info(data)
|
||||||
sccid = get_ccid(addr)
|
sccid = get_ccid(addr)
|
||||||
if not sccid:
|
if not sccid:
|
||||||
return -1
|
return -1
|
||||||
@ -322,7 +337,7 @@ def tt_decode(addr, data):
|
|||||||
class MyServer(socketserver.BaseRequestHandler):
|
class MyServer(socketserver.BaseRequestHandler):
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self.request.settimeout(60*2)
|
self.request.settimeout(60*2)
|
||||||
self.err = ""
|
self.err = " "
|
||||||
|
|
||||||
def handle(self): # 回调
|
def handle(self): # 回调
|
||||||
add_timestamp()
|
add_timestamp()
|
||||||
|
Loading…
Reference in New Issue
Block a user