pub struct ServerConfig {
pub addr: SocketAddr,
pub inner_loop_delay: Duration,
pub tm_buffer_size: usize,
pub tc_buffer_size: usize,
pub reuse_addr: bool,
pub reuse_port: bool,
}Available on crate feature
std only.Expand description
Configuration struct for the generic TCP TMTC server
§Parameters
addr- Address of the TCP server.inner_loop_delay- If a client connects for a longer period, but no TC is received or no TM needs to be sent, the TCP server will delay for the specified amount of time to reduce CPU load.tm_buffer_size- Size of the TM buffer used to read TM from the TmPacketSource and encoding of that data. This buffer should at large enough to hold the maximum expected TM size read from the packet source.tc_buffer_size- Size of the TC buffer used to read encoded telecommands sent from the client. It is recommended to make this buffer larger to allow reading multiple consecutive packets as well, for example by using common buffer sizes like 4096 or 8192 byte. The buffer should at the very least be large enough to hold the maximum expected telecommand size.reuse_addr- Can be used to set theSO_REUSEADDRoption on the raw socket. This is especially useful if the address and port are static for the server. Set to false by default.reuse_port- Can be used to set theSO_REUSEPORToption on the raw socket. This is especially useful if the address and port are static for the server. Set to false by default.
Fields§
§addr: SocketAddr§inner_loop_delay: Duration§tm_buffer_size: usize§tc_buffer_size: usize§reuse_addr: bool§reuse_port: boolImplementations§
Source§impl ServerConfig
impl ServerConfig
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
impl Copy for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.