pub enum DialPhase {
Address,
LocalSocket,
TlsConfig,
Connect,
Handshake,
}Expand description
Which stage of a dial a DialError came from.
A dial is not one event. dial_quic_to builds a TLS configuration, opens a
local socket, asks quinn to start a connection, and only then sends a packet;
the four fail for unrelated reasons and only the last of them involves the
peer at all. This is that sequence as a value, so a caller can switch on it
instead of reading the message a variant renders.
§The caller cannot supply this itself
It knows which call it made, not which stage inside the call died — and
the four stages above live inside one call. A probe recording “handshake”
for every failure of dial_quic_to is not being careless; it has nothing
finer to say until this exists. The one thing it does know that this cannot
is which transport it was dialling, which is why
Handshake does not distinguish a QUIC handshake from a
WebTransport CONNECT: both are a peer answering, and only the caller knows
which it asked.
§Exactly one of these means the peer was involved
Handshake, and DialError::is_local is that sentence
as a predicate. The other four are decided on this machine with nothing on
the wire, so a failure carrying one of them can never be evidence about the
peer — which is the direction this distinction is load-bearing in. The
converse is weaker and deliberately not claimed: a handshake that timed out
is not proof of anything the peer did either, only that the machine got as
far as sending.
Variants§
Address
Turning what the caller named into somewhere to send — parsing a
host:port, resolving it, finding it resolved to nothing.
LocalSocket
Opening a local socket to send from. See DialError::LocalSocket.
TlsConfig
Building the TLS client configuration: a ca_certs entry that is not a
certificate, a cipher suite the crypto provider does not implement.
Connect
The stack refusing to start the connection — a server name rustls will not accept, a remote address quinn will not dial. Nothing was sent.
Handshake
The handshake, and the only phase in which the peer is involved.