Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/winnow/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 5 kB image not shown  

Quelle  README.md   Sprache: unbekannt

 
Spracherkennung für: .md vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

<!-- cargo-rdme start -->

# Happy Eyeballs v3 Implementation

WORK IN PROGRESS

This crate provides an implementation of Happy Eyeballs v3 as specified in
[draft-ietf-happy-happyeyeballs-v3-02](https://www.ietf.org/archive/id/draft-ietf-happy-happyeyeballs-v3-02.html).

It is implemented as a deterministic, pure state machine. The caller drives
all I/O and timers. Current time is explicitly provided by the caller. The
state machine itself performs no side effects (e.g. network calls or
blocking operations).

Happy Eyeballs v3 is an algorithm for improving the performance of dual-stack
applications by racing IPv4 and IPv6 connections while optimizing for modern
network conditions including HTTPS service discovery and QUIC.

## Usage

```rust

let mut he = HappyEyeballs::new("example.com", 443).unwrap();
let now = Instant::now();

// First process outputs from the state machine, e.g. a DNS query to send:
while let Some(output) = he.process_output(now) {
    match output {
        Output::SendDnsQuery { id, hostname, record_type } => {
            // Send DNS query.
        }
        Output::AttemptConnection { id, endpoint, is_ech_retry } => {
            // Attempt connection.
        }
        _ => {}
    }
}

// Later pass results as input back to the state machine, e.g. a DNS
// response arrives:
he.process_input(Input::DnsResult { id: dns_id.unwrap(), result: dns_result }, Instant::now());
```

For complete example usage, see the [`tests/`](tests/).

<!-- cargo-rdme end -->

[Dauer der Verarbeitung: 0.46 Sekunden]