Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Nov 27, 2023
1 parent 85aef76 commit a43fbee
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions yamux/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ impl Default for Config {
}

impl Config {
/// Set the receive window per stream (must be >= 256 KiB).
/// Set the maximum receive window per stream .
///
/// Must be `>= 256 KiB`.
///
/// The window of a stream starts at 256 KiB and is increased (auto-tuned) based on the
/// connection's round-trip time and the stream's bandwidth (striving for the
/// bandwidth-delay-product).
///
/// Set to `None` to disable the per stream maximum receive window.
///
/// # Panics
///
Expand All @@ -112,13 +120,16 @@ impl Config {

// TODO: Is a usize really needed here?
// TODO: Should this be an option?
/// Set the maximum sum of all stream receive windows per connection.
///
/// Must be `>= 256 KiB * max_num_streams` to allow each stream the Yamux default window size.
pub fn set_max_connection_receive_window(&mut self, n: usize) -> &mut Self {
self.max_connection_receive_window = n;
self.check();
self
}

/// Set the max. number of streams.
/// Set the max. number of streams per connection.
pub fn set_max_num_streams(&mut self, n: usize) -> &mut Self {
self.max_num_streams = n;
self.check();
Expand Down

0 comments on commit a43fbee

Please sign in to comment.