Struct rust_tcp_ipc::TcpIpcConfig
source · pub struct TcpIpcConfig {
pub after_connect_wait_time: Option<Duration>,
pub read_iteration_wait_time: Option<Duration>,
pub shutdown_wait_time: Option<Duration>,
pub check_count: u32,
}
Expand description
This bundles the time-settings for the protocol A ‘None’ value means that there will no time spend waiting.
Example
let config = TcpIpcConfig {
after_connect_wait_time: Some(std::time::Duration::from_micros(5_000)),
read_iteration_wait_time: Some(std::time::Duration::from_micros(1)),
shutdown_wait_time: Some(std::time::Duration::from_micros(5_000_000)),
check_count: 1,
};
Fields
after_connect_wait_time: Option<Duration>
This is the time the program waits for the server after it accepted the initial TCP connection. For example, this can be used to wait for the server doing some initialization. Moreover, the message read queue thread needs some time to start.
read_iteration_wait_time: Option<Duration>
This is the time the client sleeps between checking for new messages from the server. Very small values can yield high CPU-usage.
shutdown_wait_time: Option<Duration>
This is the time the client waits for the server to accept a shutdown request.
check_count: u32
This is the number of iterations inside the read thread after which the busy_update_state will be checked A good default value is 1 (check after each iteration)
Trait Implementations
sourceimpl Clone for TcpIpcConfig
impl Clone for TcpIpcConfig
sourcefn clone(&self) -> TcpIpcConfig
fn clone(&self) -> TcpIpcConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for TcpIpcConfig
impl Debug for TcpIpcConfig
sourceimpl PartialEq<TcpIpcConfig> for TcpIpcConfig
impl PartialEq<TcpIpcConfig> for TcpIpcConfig
sourcefn eq(&self, other: &TcpIpcConfig) -> bool
fn eq(&self, other: &TcpIpcConfig) -> bool
impl Copy for TcpIpcConfig
impl StructuralPartialEq for TcpIpcConfig
Auto Trait Implementations
impl RefUnwindSafe for TcpIpcConfig
impl Send for TcpIpcConfig
impl Sync for TcpIpcConfig
impl Unpin for TcpIpcConfig
impl UnwindSafe for TcpIpcConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more