[][src]Struct zenoh_protocol::proto::Accept

pub struct Accept {
    pub whatami: WhatAmI,
    pub opid: PeerId,
    pub apid: PeerId,
    pub initial_sn: ZInt,
    pub sn_resolution: Option<ZInt>,
    pub lease: Option<ZInt>,
    pub locators: Option<Vec<Locator>>,
}

NOTE: 16 bits (2 bytes) may be prepended to the serialized message indicating the total lenght in bytes of the message, resulting in the maximum lenght of a message being 65_536 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 lenght of a message must not exceed 65_535 bytes.

The ACCEPT message is sent in response of an OPEN message in case of accepting the new incoming session.

7 6 5 4 3 2 1 0 +-+-+-+-+-+-+-+-+ |X|X|O| ACCEPT | +-+-+-+-+-------+ ~ whatami ~ -- Client, Broker, Router, Peer or a combination of them +---------------+ ~ o_peer_id ~ -- PID of the sender of the OPEN this ACCEPT is for +---------------+ ~ a_peer_id ~ -- PID of the sender of the ACCEPT +---------------+ ~ initial_sn ~ -- Initial SN proposed by the sender of the ACCEPT(*) +-+-+-+-+-+-+-+-+ |L|S|D|X|X|X|X|X| if O==1 +-+-+-+-+-+-+---+ ~ sn_resolution + if S==1 -- Agreed SN Resolution(**) +---------------+ ~ lease_period ~ if D==1 +---------------+ ~ Locators ~ if L==1 +---------------+

  • if S==0 then the agreed sequence number resolution is the one indicated in the OPEN message.

  • if S==1 then the agreed sequence number resolution is the one indicated in this ACCEPT message. The resolution in the ACCEPT must be less or equal than the resolution in the OPEN, otherwise the ACCEPT message is consmsg::idered invalid and it should be treated as a CLOSE message with L==0 by the Opener Peer -- the recipient of the ACCEPT message.

  • if D==0 then the agreed lease period is the one indicated in the OPEN message.

  • if D==1 then the agreed lease period is the one indicated in this ACCEPT message. The lease period in the ACCEPT must be less or equal than the lease period in the OPEN, otherwise the ACCEPT message is consmsg::idered invalid and it should be treated as a CLOSE message with L==0 by the Opener Peer -- the recipient of the ACCEPT message.

(*) The Initial SN is bound to the proposed SN Resolution. (**) In case of the SN Resolution proposed in this ACCEPT message is smaller than the SN Resolution proposed in the OPEN message AND the Initial SN contained in the OPEN messages results to be out-of-bound, the new Agreed Initial SN for the Opener Peer is calculated according to the following modulo operation: Agreed Initial SN := (Initial SN_Open) mod (SN Resolution_Accept)

Fields

whatami: WhatAmIopid: PeerIdapid: PeerIdinitial_sn: ZIntsn_resolution: Option<ZInt>lease: Option<ZInt>locators: Option<Vec<Locator>>

Trait Implementations

impl Clone for Accept[src]

impl Debug for Accept[src]

impl PartialEq<Accept> for Accept[src]

impl StructuralPartialEq for Accept[src]

Auto Trait Implementations

impl RefUnwindSafe for Accept

impl Send for Accept

impl Sync for Accept

impl Unpin for Accept

impl UnwindSafe for Accept

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,