Constants§
- COMPRESSION_
THRESHOLD - Minimum body size above which we attempt zlib compression.
Functions§
- build_
container_ body - Build the body of a
msg_container#73f1f8dcfrom a list of(msg_id, seqno, body)inner messages. - build_
msgs_ ack_ body - Build the TL body for
msgs_ack#62d6b459 msg_ids:Vector<long>. - crc32_
ieee - CRC-32 using the standard IEEE 802.3 polynomial (for Full transport framing).
- gz_
inflate - gz_
pack_ body - Wrap
datain agzip_packed#3072cfa1 packed_data:bytesTL frame. - jitter_
delay - Apply ±20 % random jitter to a backoff delay. Prevents thundering-herd when many clients reconnect simultaneously (e.g. after a server restart or a shared network outage).
- maybe_
gz_ decompress - maybe_
gz_ pack - Optionally compress
data. Returns the compressedgzip_packedwrapper if it is shorter than the original; otherwise returnsdataunchanged. - random_
i64 - tl_
read_ bytes - tl_
read_ string - tl_
write_ bytes - TL
byteswire encoding (used inside gzip_packed).