Module ts3_query::managed [−][src]
This is supported on crate feature
managed
only.Expand description
Managed connection module. Handles reconnection and name uniqueness. Wraps a normal query connection with health checks. Handles renaming and claimed names. Useful if running long-lasting connections which tend to break over the wire.
use ts3_query::*; let cfg = managed::ManagedConfig::new("127.0.0.1:10011",9987,"serveradmin".into(),"asdf".into())? .name("my bot".to_string()); let mut conn = managed::ManagedConnection::new(cfg)?; // get inner connection with check for being alive // then perform a command on it let _ = conn.get()?.whoami(false)?;
Structs
ManagedConfig | Config for creating a managed connection |
ManagedConnection | QueryClient wrapper with connection-check on access |
Constants
DEFAULT_TIMEOUT_CMD | Default timeout for sending/receiving |
DEFAULT_TIMEOUT_CONN | Default connection timeout |
MAX_LEN_NAME | Max name length to allow unique names |