pub fn connect(&self, proto: Transport, addr: SocketAddr) -> Result<(), NetworkBridgeErr> {
        match proto {
            Transport::TCP => {
                self.network_input_queue
                    .send(events::DispatchEvent::Connect(addr))?;
                self.waker.wake()?;
                Ok(())
            }
            _other => Err(NetworkBridgeErr::Other("Bad Protocol".to_string())),
        }
    }
/// Attempts to establish a TCP connection to the provided `addr`.
///
/// # Side effects
/// When the connection is successul:
///     - a `ConnectionState::Connected` is dispatched on the network bridge event queue
///     - NetworkThread will listen for incoming messages and write outgoing messages on the channel
///
/// # Errors
/// If the provided protocol is not supported
Attempts to establish a TCP connection to the provided `addr`.
Attempts to establish a TCP connection to the provided ` addr ` .
pub fn connect(&self, proto: Transport, addr: SocketAddr) -> Result<(), NetworkBridgeErr> {
        match proto {
            Transport::TCP => {
                self.network_input_queue
                    .send(events::DispatchEvent::Connect(addr))?;
                self.waker.wake()?;
                Ok(())
            }
            _other => Err(NetworkBridgeErr::Other("Bad Protocol".to_string())),
        }
    }
pub fn connect ( & self , proto : Transport , addr : SocketAddr ) -> Result < ( ) , NetworkBridgeErr > { match proto { Transport :: TCP => { self . network_input_queue . send ( events :: DispatchEvent :: Connect ( addr ) ) ? ; self . waker . wake ( ) ? ; Ok ( ( ) ) } _other => Err ( NetworkBridgeErr :: Other ( " " . to_string ( ) ) ) , } }
Attempts to establish a TCP connection to the provided `addr`.
Attempts to establish a TCP connection to the provided ` addr ` .
&self
proto
Transport
addr
SocketAddr
&self
proto
Transport
addr
SocketAddr
side effects
When the connection is successul:
a `ConnectionState::Connected` is dispatched on the network bridge event queue
NetworkThread will listen for incoming messages and write outgoing messages on the channel
When the connection is successul : a ` ConnectionState :: Connected ` is dispatched on the network bridge event queue NetworkThread will listen for incoming messages and write outgoing messages on the channel
errors
If the provided protocol is not supported
If the provided protocol is not supported