pub(crate) fn connect(addr: SocketAddr) -> impl Future<Item = NatsConnection, Error = NatsError> {
    NatsConnectionInner::connect_tcp(&addr).map(move |socket| {
        debug!(target: "nitox", "Connected through TCP");
        NatsConnection {
            is_tls: false,
            addr,
            host: None,
            state: Arc::new(RwLock::new(NatsConnectionState::Connected)),
            inner: Arc::new(RwLock::new(socket.into())),
        }
    })
}
/// Connect to a raw TCP socket
Connect to a raw TCP socket
Connect to a raw TCP socket
pub(crate) fn connect(addr: SocketAddr) -> impl Future<Item = NatsConnection, Error = NatsError> {
    NatsConnectionInner::connect_tcp(&addr).map(move |socket| {
        debug!(target: "nitox", "Connected through TCP");
        NatsConnection {
            is_tls: false,
            addr,
            host: None,
            state: Arc::new(RwLock::new(NatsConnectionState::Connected)),
            inner: Arc::new(RwLock::new(socket.into())),
        }
    })
}
pub ( crate ) fn connect ( addr : SocketAddr ) -> impl Future < Item = NatsConnection , Error = NatsError > { NatsConnectionInner :: connect_tcp ( & addr ) . map ( move | socket | { debug ! ( target " " " " ) ; NatsConnection { is_tls : false , addr , host : None , state : Arc :: new ( RwLock :: new ( NatsConnectionState :: Connected ) ) , inner : Arc :: new ( RwLock :: new ( socket . into ( ) ) ) , } } ) }
Connect to a raw TCP socket
Connect to a raw TCP socket
addr
SocketAddr
addr
SocketAddr