Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove message size restriction #84
Change how the initial message header is constructed. To get the initial header, the following script would work:
def how_many_bytes(i): num_bytes = 0 while i: i >>= 8 num_bytes += 1 return num_bytes def pack_header(i): lengths = [i] string = b"" while i != 1 or lengths == : i = how_many_bytes(lengths[-1]) lengths.append(i) for index, length in enumerate(lengths[:-1]): print("Packing %i into %i bytes" % (length, lengths[index + 1])) string = pack_value(lengths[index + 1], length) + string return b'\x01' + string
This expands the possible message length to infinite scale. This proposal assumes that all headers are structured this way, including the packet separators.