a 2-byte network-endian packed key length (of which the first byte
must be null, and the second must be non-null: i.e. the value of
the length must be 1-255)

a key, comprised of that many bytes

a 2-byte network-endian unsigned value length (up to the maximum of
65535)

a value, comprised of that many bytes

2 null bytes

In other words, an even number of strings prefixed with packed unsigned
16-bit integers, and then a 0-length string to indicate the end of the
box.

This protocol also implements 2 extra private bits of functionality
related to the byte boundaries between messages; it can start TLS between
two given boxes or switch to an entirely different protocol. However, due
to some tricky elements of the implementation, the public interface to this
functionality is ProtocolSwitchCommand
and StartTLS.

Switch this BinaryBoxProtocol's transport to a new protocol. You need
to do this 'simultaneously' on both ends of a connection; the easiest way
to do this is to use a subclass of ProtocolSwitchCommand.

bytes received, but not yet broken up into messages / sent to
stringReceived. _compatibilityOffset must be updated when this value is
updated so that the recvd attribute can be generated
correctly. (type: bytes)

Temporary storage for all file descriptors received. Values in this
dictionary are the file descriptors (as integers). Keys in this dictionary
are ordinals giving the order in which each descriptor was received. The
ordering information is used to allow Descriptor to
determine which is the correct descriptor for any particular usage of that
argument type. (type: dict)

Switch this BinaryBoxProtocol's transport to a new protocol. You need
to do this 'simultaneously' on both ends of a connection; the easiest way
to do this is to use a subclass of ProtocolSwitchCommand.

Lock this binary protocol so that no further boxes may be sent. This is
used when sending a request to switch underlying protocols. You probably
want to subclass ProtocolSwitchCommand rather than calling this
directly.