[−][src]Struct tox_packet::relay::PingRequest
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:
Length | Content |
---|---|
1 | 0x04 |
8 | ping_id in BigEndian |
Fields
ping_id: u64
The id of ping
Trait Implementations
impl Clone for PingRequest
[src]
pub fn clone(&self) -> PingRequest
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PingRequest
[src]
impl FromBytes for PingRequest
[src]
impl PartialEq<PingRequest> for PingRequest
[src]
pub fn eq(&self, other: &PingRequest) -> bool
[src]
pub fn ne(&self, other: &PingRequest) -> bool
[src]
impl StructuralPartialEq for PingRequest
[src]
impl ToBytes for PingRequest
[src]
Auto Trait Implementations
impl RefUnwindSafe for PingRequest
[src]
impl Send for PingRequest
[src]
impl Sync for PingRequest
[src]
impl Unpin for PingRequest
[src]
impl UnwindSafe for PingRequest
[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>,