[][src]Struct tox_packet::relay::PingRequest

pub struct PingRequest {
    pub ping_id: u64,
}

Sent by both client and server, both will respond. Ping packets are used to know if the other side of the connection is still live. TCP when established doesn't have any sane timeouts (1 week isn't sane) so we are obliged to have our own way to check if the other side is still live. Ping ids can be anything except 0, this is because of how toxcore sets the variable storing the ping_id that was sent to 0 when it receives a pong response which means 0 is invalid.

The server should send ping packets every X seconds (toxcore TCP_server sends them every 30 seconds and times out the peer if it doesn't get a response in 10). The server should respond immediately to ping packets with pong packets.

Serialized form:

LengthContent
10x04
8ping_id in BigEndian

Fields

ping_id: u64

The id of ping

Trait Implementations

impl Clone for PingRequest[src]

impl Debug for PingRequest[src]

impl FromBytes for PingRequest[src]

impl PartialEq<PingRequest> for PingRequest[src]

impl StructuralPartialEq for PingRequest[src]

impl ToBytes for PingRequest[src]

Auto Trait Implementations

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> 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.