rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.94k stars 12.78k forks source link

Tracking Issue for TCP_QUICKACK support on Linux #96256

Open berendjan opened 2 years ago

berendjan commented 2 years ago

Feature gate: #![feature(tcp_quickack)]

This is a tracking issue for linux specific socket option TCP_QUICKACK

from linux man page TCP: "Enable quickack mode if set or disable quickack mode if cleared. In quickack mode, acks are sent immediately, rather than delayed if needed in accordance to normal TCP operation. This flag is not permanent, it only enables a switch to or from quickack mode. Subsequent operation of the TCP protocol will once again enter/leave quickack mode depending on internal protocol processing and factors such as delayed ack timeouts occurring and data transfer. This option should not be used in code intended to be portable."

Public API

// std::os::linux::net

// sealed trait, implemented for std::net::TcpStream
pub trait TcpStreamExt: Sealed{
  fn quickack(&self) -> io::Result<bool>;
  fn set_quickack(&self, quickack: bool) -> io::Result<()>;
}

Steps / History

Unresolved Questions

Zulip Discussion Windows .NET Discussion

Seems the windows API is significantly different from the Linux one to warrant a Linux specific trait.

jmillikin commented 2 years ago

FYI: The same modules are also being touched as part of the work on supporting abstract socket addresses -- see https://github.com/rust-lang/rust/issues/85410 and https://github.com/rust-lang/rust/pull/101967 for details.

I tried to keep the code intact (merely relocated), so hopefully there won't be any major conflicts.

devnexen commented 3 months ago

The following PR proposes to stabilise the tcp_quickack feature, being present since 2yrs+ now.