Skip to main content

dial_quic

Function dial_quic 

Source
pub async fn dial_quic(
    addr: &str,
    options: &QuicDialOptions,
) -> Result<(Transport, Option<Vec<u8>>), DialError>
Expand description

Resolve addr and dial the first address that answers.

Keeps the signature every draft module’s connect_quic already calls, so all fourteen reach this resolution without any of them being touched.

Why it resolves rather than parses: addr.parse::<SocketAddr>() accepts numeric literals and nothing else, so every hostname fails with invalid address: invalid socket address syntax before a packet is sent — a loopback interop suite passes while every public relay is unreachable. Resolving in the caller is not an answer either: the resolved IP becomes the SNI and the certificate check runs against it. resolve hands back the name and the addresses separately, which is what QuicTarget has two fields for.

One connection is what this returns, so one is what it looks for; a caller that needs to know an address failed, rather than that some address worked, wants dial_quic_to per address instead.