pub(crate) fn connect_tls(host: String, addr: SocketAddr) -> impl Future<Item = NatsConnection, Error = NatsError> {
    let inner_host = host.clone();
    NatsConnectionInner::connect_tcp(&addr)
        .and_then(move |socket| {
            debug!(target: "nitox", "Connected through TCP, upgrading to TLS");
            NatsConnectionInner::upgrade_tcp_to_tls(&host, socket)
        }).map(move |socket| {
            debug!(target: "nitox", "Connected through TCP over TLS");
            NatsConnection {
                is_tls: true,
                addr,
                host: Some(inner_host),
                state: Arc::new(RwLock::new(NatsConnectionState::Connected)),
                inner: Arc::new(RwLock::new(socket.into())),
            }
        })
}
/// Connect to a TLS over TCP socket. Upgrade is performed automatically
Connect to a TLS over TCP socket. Upgrade is performed automatically
Connect to a TLS over TCP socket . Upgrade is performed automatically
pub(crate) fn connect_tls(host: String, addr: SocketAddr) -> impl Future<Item = NatsConnection, Error = NatsError> {
    let inner_host = host.clone();
    NatsConnectionInner::connect_tcp(&addr)
        .and_then(move |socket| {
            debug!(target: "nitox", "Connected through TCP, upgrading to TLS");
            NatsConnectionInner::upgrade_tcp_to_tls(&host, socket)
        }).map(move |socket| {
            debug!(target: "nitox", "Connected through TCP over TLS");
            NatsConnection {
                is_tls: true,
                addr,
                host: Some(inner_host),
                state: Arc::new(RwLock::new(NatsConnectionState::Connected)),
                inner: Arc::new(RwLock::new(socket.into())),
            }
        })
}
pub ( crate ) fn connect_tls ( host : String , addr : SocketAddr ) -> impl Future < Item = NatsConnection , Error = NatsError > { let inner_host = host . clone ( ) ; NatsConnectionInner :: connect_tcp ( & addr ) . and_then ( move | socket | { debug ! ( target " " " " ) ; NatsConnectionInner :: upgrade_tcp_to_tls ( & host , socket ) } ) . map ( move | socket | { debug ! ( target " " " " ) ; NatsConnection { is_tls : true , addr , host : Some ( inner_host ) , state : Arc :: new ( RwLock :: new ( NatsConnectionState :: Connected ) ) , inner : Arc :: new ( RwLock :: new ( socket . into ( ) ) ) , } } ) }
Connect to a TLS over TCP socket.
Connect to a TLS over TCP socket .
host
String
addr
SocketAddr
host
String
addr
SocketAddr