test udp limits 366KB

This commit is contained in:
Arturo Hernandez 2017-12-09 13:39:16 -04:00
parent 27b4996b02
commit 2adf1d3e1b

View File

@ -441,11 +441,15 @@ class ZK(object):
if cmd_response.get('status'): if cmd_response.get('status'):
if cmd_response.get('code') == const.CMD_PREPARE_DATA: if cmd_response.get('code') == const.CMD_PREPARE_DATA:
bytes = self.__get_data_size() bytes = self.__get_data_size()
print "user size is %s" % bytes
userdata = [] userdata = []
while bytes > 0: while bytes > 0:
data_recv = self.__sock.recv(1032) data_recv = self.__sock.recv(1032)
response = unpack('HHHH', data_recv[:8])[0]
print "this packet response is: %s" % response
userdata.append(data_recv) userdata.append(data_recv)
bytes -= 1024 bytes -= 1024
print "user still needs %s" % bytes
data_recv = self.__sock.recv(8) data_recv = self.__sock.recv(8)
response = unpack('HHHH', data_recv[:8])[0] response = unpack('HHHH', data_recv[:8])[0]
@ -542,11 +546,21 @@ class ZK(object):
if cmd_response.get('status'): if cmd_response.get('status'):
if cmd_response.get('code') == const.CMD_PREPARE_DATA: if cmd_response.get('code') == const.CMD_PREPARE_DATA:
bytes = self.__get_data_size() bytes = self.__get_data_size()
print "size is %s" % bytes
attendance_data = [] attendance_data = []
pac = 1
while bytes > 0: while bytes > 0:
data_recv = self.__sock.recv(1032) data_recv = self.__sock.recv(1032)
response = unpack('HHHH', data_recv[:8])[0]
print "# %s packet response is: %s" % (pac, response)
if response == const.CMD_ACK_OK:
#truncado! continuar?
print "broken!"
break
pac += 1
attendance_data.append(data_recv) attendance_data.append(data_recv)
bytes -= 1024 bytes -= 1024
#print "still needs %s" % bytes
data_recv = self.__sock.recv(8) data_recv = self.__sock.recv(8)
response = unpack('HHHH', data_recv[:8])[0] response = unpack('HHHH', data_recv[:8])[0]