|
1 |
| -/// HTTP2 Ping usage |
2 |
| -/// |
3 |
| -/// hyper uses HTTP2 pings for two purposes: |
4 |
| -/// |
5 |
| -/// 1. Adaptive flow control using BDP |
6 |
| -/// 2. Connection keep-alive |
7 |
| -/// |
8 |
| -/// Both cases are optional. |
9 |
| -/// |
10 |
| -/// # BDP Algorithm |
11 |
| -/// |
12 |
| -/// 1. When receiving a DATA frame, if a BDP ping isn't outstanding: |
13 |
| -/// 1a. Record current time. |
14 |
| -/// 1b. Send a BDP ping. |
15 |
| -/// 2. Increment the number of received bytes. |
16 |
| -/// 3. When the BDP ping ack is received: |
17 |
| -/// 3a. Record duration from sent time. |
18 |
| -/// 3b. Merge RTT with a running average. |
19 |
| -/// 3c. Calculate bdp as bytes/rtt. |
20 |
| -/// 3d. If bdp is over 2/3 max, set new max to bdp and update windows. |
| 1 | +//! HTTP2 Ping usage |
| 2 | +//! |
| 3 | +//! hyper uses HTTP2 pings for two purposes: |
| 4 | +//! |
| 5 | +//! 1. Adaptive flow control using BDP |
| 6 | +//! 2. Connection keep-alive |
| 7 | +//! |
| 8 | +//! Both cases are optional. |
| 9 | +//! |
| 10 | +//! # BDP Algorithm |
| 11 | +//! |
| 12 | +//! 1. When receiving a DATA frame, if a BDP ping isn't outstanding: |
| 13 | +//! 1a. Record current time. |
| 14 | +//! 1b. Send a BDP ping. |
| 15 | +//! 2. Increment the number of received bytes. |
| 16 | +//! 3. When the BDP ping ack is received: |
| 17 | +//! 3a. Record duration from sent time. |
| 18 | +//! 3b. Merge RTT with a running average. |
| 19 | +//! 3c. Calculate bdp as bytes/rtt. |
| 20 | +//! 3d. If bdp is over 2/3 max, set new max to bdp and update windows. |
| 21 | +
|
21 | 22 | use std::fmt;
|
22 | 23 | use std::future::Future;
|
23 | 24 | use std::pin::Pin;
|
|
0 commit comments