[−][src]Enum tox_core::net_crypto::ConnectionStatus
Status of crypto connection.
Initial state is CookieRequesting
. In this status we send up to 8
CookieRequest
packets every second and waiting for a CookieResponse
packet.
After receiving a CookieResponse
packet we change the status to
HandshakeSending
in which we send up to 8 CryptoHandshake
packets every
second and waiting for CryptoHandshake
packet from the other side. When we
received CryptoHandshake
packet we change the status to NotConfirmed
and
continue sending CryptoHandshake
packets because we don't know if the other
side received our CryptoHandshake
packet. Only after receiving first
CryptoData
packet we change status to Established
and stop sending
CryptoHandshake
packets. In this status connection is considered as fully
established.
It's also possible that we received CryptoHandshake
packet but didn't create
crypto connection yet. This means that we should skip first two states and use
NotConfirmed
state as initial. We can do it because CryptoHandshake
contains
Cookie
that we can use to send our CryptoHandshake
.
Variants
We are sending cookie request packets and haven't received cookie response yet.
Fields of CookieRequesting
ID used in the cookie request packets for this connection
packet: StatusPacketWithTime
Packet that should be sent every second
We are sending handshake packets and haven't received handshake from the other side yet.
Fields of HandshakeSending
sent_nonce: Nonce
Nonce that should be used to encrypt outgoing packets
packet: StatusPacketWithTime
Packet that should be sent every second
A handshake packet has been received from the other side but no encrypted packets. Continue sending handshake packets because we can't know if the other side has received them.
Fields of NotConfirmed
sent_nonce: Nonce
Nonce that should be used to encrypt outgoing packets
received_nonce: Nonce
Nonce that should be used to decrypt incoming packets
session_precomputed_key: PrecomputedKey
PrecomputedKey
for this session that is used to encrypt and
decrypt data packets
packet: StatusPacketWithTime
Packet that should be sent every second
A valid encrypted packet has been received from the other side. Connection is fully established.
Fields of Established
Trait Implementations
impl Clone for ConnectionStatus
[src]
pub fn clone(&self) -> ConnectionStatus
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConnectionStatus
[src]
impl Eq for ConnectionStatus
[src]
impl PartialEq<ConnectionStatus> for ConnectionStatus
[src]
pub fn eq(&self, other: &ConnectionStatus) -> bool
[src]
pub fn ne(&self, other: &ConnectionStatus) -> bool
[src]
impl StructuralEq for ConnectionStatus
[src]
impl StructuralPartialEq for ConnectionStatus
[src]
Auto Trait Implementations
impl RefUnwindSafe for ConnectionStatus
[src]
impl Send for ConnectionStatus
[src]
impl Sync for ConnectionStatus
[src]
impl Unpin for ConnectionStatus
[src]
impl UnwindSafe for ConnectionStatus
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,