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 established
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 preferred over throughput; false
(default on Linux) to use all the available bandwidth
(sending full packets, waiting up to 200ms for fulfillment).
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
impl StructuralPartialEq for SocketOptions
Auto Trait Implementations§
impl Freeze for SocketOptions
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