On this page
Trait std::os::linux::net::TcpStreamExt
pub trait TcpStreamExt: Sealed {
// Required methods
fn set_quickack(&self, quickack: bool) -> Result<()>;
fn quickack(&self) -> Result<bool>;
}
🔬This is a nightly-only experimental API. (
tcp_quickack
#96256)
Available on Linux and (Linux or Android) only.
Os-specific extensions for TcpStream
Required Methods
fn set_quickack(&self, quickack: bool) -> Result<()>
🔬This is a nightly-only experimental API. (
tcp_quickack
#96256)
Enable or disable TCP_QUICKACK
.
This flag causes Linux to eagerly send ACKs rather than delaying them. Linux may reset this flag after further operations on the socket.
See man 7 tcp
and TCP delayed acknowledgement for more information.
Examples
#![feature(tcp_quickack)]
use std::net::TcpStream;
use std::os::linux::net::TcpStreamExt;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_quickack(true).expect("set_quickack call failed");
fn quickack(&self) -> Result<bool>
🔬This is a nightly-only experimental API. (
tcp_quickack
#96256)
Gets the value of the TCP_QUICKACK
option on this socket.
For more information about this option, see TcpStreamExt::set_quickack
.
Examples
#![feature(tcp_quickack)]
use std::net::TcpStream;
use std::os::linux::net::TcpStreamExt;
let stream = TcpStream::connect("127.0.0.1:8080")
.expect("Couldn't connect to the server...");
stream.set_quickack(true).expect("set_quickack call failed");
assert_eq!(stream.quickack().unwrap_or(false), true);
Implementors
impl TcpStreamExt for TcpStream
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/os/linux/net/trait.TcpStreamExt.html