Struct reactive_messaging::prelude::SocketOptions
source · pub struct SocketOptions {
pub hops_to_live: Option<NonZeroU8>,
pub linger_millis: Option<u32>,
pub no_delay: Option<bool>,
}Expand description
Socket options for the local peer to be set when the connection is stablished
Fields§
§hops_to_live: Option<NonZeroU8>Also known as time-to-live (TTL), specifies how many hops may relay an outgoing packet before it being dropped and an error being returned.
If NonZero, will cause the socket configuration function to be called with that value.
linger_millis: Option<u32>If specified, must be a power of 2 with the number of milliseconds to wait for any unsent messages when closing the connection.
In Linux, defaults to 0.
no_delay: Option<bool>Set this to true if lower latency is prefered over throughput; false (default on Linux) to use all the available bandwidth
(sending full packets, waiting up to 200ms for fullfilment).
None will leave it as the system’s default – in Linux, false.
Some hints:
- The peer reporting events may prefer to set it to
true; - The other peer, receiving events from many, many peers and sending messages that won’t be used for decision making, may set it to
false
Trait Implementations§
source§impl Debug for SocketOptions
impl Debug for SocketOptions
source§impl PartialEq for SocketOptions
impl PartialEq for SocketOptions
source§fn eq(&self, other: &SocketOptions) -> bool
fn eq(&self, other: &SocketOptions) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for SocketOptions
Auto Trait Implementations§
impl RefUnwindSafe for SocketOptions
impl Send for SocketOptions
impl Sync for SocketOptions
impl Unpin for SocketOptions
impl UnwindSafe for SocketOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more