Skip to content

Commit

Permalink
transports/tcp: make TCP_NODELAY the default
Browse files Browse the repository at this point in the history
  • Loading branch information
elenaf9 committed Dec 25, 2024
1 parent 4c03ac9 commit 86c1e5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions transports/tcp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ impl PortReuse {
impl Config {
/// Creates a new configuration for a TCP/IP transport:
///
/// * Nagle's algorithm, i.e. `TCP_NODELAY`, is _enabled_. See [`Config::nodelay`].
/// * Nagle's algorithm is _disabled_, i.e. `TCP_NODELAY` _enabled_. See [`Config::nodelay`].
/// * Reuse of listening ports is _disabled_. See [`Config::port_reuse`].
/// * No custom `IP_TTL` is set. The default of the OS TCP stack applies. See [`Config::ttl`].
/// * The size of the listen backlog for new listening sockets is `1024`. See
/// [`Config::listen_backlog`].
pub fn new() -> Self {
Self {
ttl: None,
nodelay: false, // Disable Nagle's algorithm by default
nodelay: true, // Disable Nagle's algorithm by default.
backlog: 1024,
}
}
Expand Down

0 comments on commit 86c1e5d

Please sign in to comment.