pub(crate) async fn dial(
        &self,
        addr: SocketAddr,
    ) -> Result<Connection, quinn_proto::ConnectError> {
        // The two `expect`s below can panic if the background task has stopped. The background
        // task can stop only if the `Endpoint` is destroyed or if the task itself panics. In other
        // words, we panic here iff a panic has already happened somewhere else, which is a
        // reasonable thing to do.
        let (tx, rx) = oneshot::channel();
        self.to_endpoint
            .lock()
            .await
            .send(ToEndpoint::Dial { addr, result: tx })
            .await
            .expect("background task has crashed");
        info!("Sent dial message, awaiting response");
        rx.await.expect("background task has crashed")
    }
/// Asks the endpoint to start dialing the given address.
///
/// Note that this method only *starts* the dialing. `Ok` is returned as soon as possible, even
/// when the remote might end up being unreachable.
Asks the endpoint to start dialing the given address.
Note that this method only *starts* the dialing. `Ok` is returned as soon as possible, even
when the remote might end up being unreachable.
Asks the endpoint to start dialing the given address . Note that this method only * starts * the dialing . ` Ok ` is returned as soon as possible even when the remote might end up being unreachable .
pub(crate) async fn dial(
        &self,
        addr: SocketAddr,
    ) -> Result<Connection, quinn_proto::ConnectError> {
        // The two `expect`s below can panic if the background task has stopped. The background
        // task can stop only if the `Endpoint` is destroyed or if the task itself panics. In other
        // words, we panic here iff a panic has already happened somewhere else, which is a
        // reasonable thing to do.
        let (tx, rx) = oneshot::channel();
        self.to_endpoint
            .lock()
            .await
            .send(ToEndpoint::Dial { addr, result: tx })
            .await
            .expect("background task has crashed");
        info!("Sent dial message, awaiting response");
        rx.await.expect("background task has crashed")
    }
pub ( crate ) async fn dial ( & self , addr : SocketAddr , ) -> Result < Connection , quinn_proto :: ConnectError > { // The two `expect`s below can panic if the background task has stopped. The background // task can stop only if the `Endpoint` is destroyed or if the task itself panics. In other // words, we panic here iff a panic has already happened somewhere else, which is a // reasonable thing to do. let ( tx , rx ) = oneshot :: channel ( ) ; self . to_endpoint . lock ( ) . await . send ( ToEndpoint :: Dial { addr , result : tx } ) . await . expect ( " " ) ; info ! ( " " ) ; rx . await . expect ( " " ) }
Asks the endpoint to start dialing the given address.
Asks the endpoint to start dialing the given address .
&self
addr
SocketAddr
&self
addr
SocketAddr