Struct net_utils::net::conn::Connection
[−]
[src]
pub struct Connection { pub reader: BufReader<NetStream>, pub writer: BufWriter<NetStream>, // some fields omitted }
A Connection object. Make sure you syncronize if uses in multiple threads
Fields
reader: BufReader<NetStream>
BufReader for NetStream (TCP/SSL)
writer: BufWriter<NetStream>
BufWriter for NetStream (TCP/SSL)
Methods
impl Connection
[src]
Implementation for Connectio
fn connect(config: &Config) -> Result<Connection>
[src]
connection unique id Creates a TCP connection to the specified server.
fn reconnect(&mut self) -> Result<Connection>
[src]
Creates a TCP/SSL connection to the specified server. If already connected, it will drop and reconnect
fn id(&self) -> &String
[src]
Get the connection id
fn is_valid(&self) -> bool
[src]
Is Valid connection