Expand description
NOTE: 16 bits (2 bytes) may be prepended to the serialized message indicating the total length
in bytes of the message, resulting in the maximum length of a message being 65_535 bytes.
This is necessary in those stream-oriented transports (e.g., TCP) that do not preserve
the boundary of the serialized messages. The length is encoded as little-endian.
In any case, the length of a message must not exceed 65_535 bytes.
The JOIN message is sent on a multicast Locator to advertise the transport parameters.
7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
|O|S|T| JOIN |
+-+-+-+-+-------+
~ |Q~ if O==1
+---------------+
| v_maj | v_min | -- Protocol Version VMaj.VMin
+-------+-------+
~ whatami ~ -- Router, Peer or a combination of them
+---------------+
~ peer_id ~ -- PID of the sender of the JOIN message
+---------------+
~ lease ~ -- Lease period of the sender of the JOIN message(*)
+---------------+
~ sn_resolution ~ if S==1(*) -- Otherwise 2^28 is assumed(**)
+---------------+
~ [next_sn] ~ (***)
+---------------+
- if Q==1 then the sender supports QoS.
(*) if T==1 then the lease period is expressed in seconds, otherwise in milliseconds
(**) if S==0 then 2^28 is assumed.
(***) if Q==1 then 8 sequence numbers are present: one for each priority.
if Q==0 then only one sequence number is present.
1660
1661
1662
1663
1664
1665
1666
fn options(&self) -> ZInt {
let mut options = 0;
if self.is_qos() {
options |= tmsg::join_options::QOS;
}
options
}
Performs copy-assignment from
source.
Read more
Formats the value using the given formatter.
Read more
This method tests for self and other values to be equal, and is used
by ==.
This method tests for !=. The default implementation is almost always
sufficient, and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.