pub async fn tcp_connect<U>(addr: SocketAddr, codec: U) -> io::Result<Self>
    where
        U: Codec + Send + 'static,
    {
        let transport = Transport::<TcpStream, U>::connect(addr, codec).await?;
        let details = SessionDetails::Tcp {
            addr,
            tag: transport.to_connection_tag(),
        };
        debug!(
            "Session has been established with {}",
            transport
                .peer_addr()
                .map(|x| x.to_string())
                .unwrap_or_else(|_| String::from("???"))
        );
        Self::initialize_with_details(transport, Some(details))
    }
/// Connect to a remote TCP server using the provided information
Connect to a remote TCP server using the provided information
Connect to a remote TCP server using the provided information
pub async fn tcp_connect<U>(addr: SocketAddr, codec: U) -> io::Result<Self>
    where
        U: Codec + Send + 'static,
    {
        let transport = Transport::<TcpStream, U>::connect(addr, codec).await?;
        let details = SessionDetails::Tcp {
            addr,
            tag: transport.to_connection_tag(),
        };
        debug!(
            "Session has been established with {}",
            transport
                .peer_addr()
                .map(|x| x.to_string())
                .unwrap_or_else(|_| String::from("???"))
        );
        Self::initialize_with_details(transport, Some(details))
    }
pub async fn tcp_connect < U > ( addr : SocketAddr , codec : U ) -> io :: Result < Self > where U : Codec + Send + ' static , { let transport = Transport :: < TcpStream , U > :: connect ( addr , codec ) . await ? ; let details = SessionDetails :: Tcp { addr , tag : transport . to_connection_tag ( ) , } ; debug ! ( " " transport peer_addr ( ) map ( x x to_string ( ) ) unwrap_or_else ( String from ( " " ) ) ) ; Self :: initialize_with_details ( transport , Some ( details ) ) }
Connect to a remote TCP server using the provided information
Connect to a remote TCP server using the provided information
addr
SocketAddr
codec
U