Struct asio::ip::NoDelay [] [src]

pub struct NoDelay(_);

Socket option for disabling the Nagle algorithm.

Implements the IPPROTO_TCP/TCP_NODELAY socket option.

Examples

Setting the option:

use asio::*;
use asio::ip::*;

let io = &IoService::new();
let soc = TcpSocket::new(io, Tcp::v4()).unwrap();

soc.set_option(NoDelay::new(true)).unwrap();

Getting the option:

use asio::*;
use asio::ip::*;

let io = &IoService::new();
let soc = TcpSocket::new(io, Tcp::v4()).unwrap();

let opt: NoDelay = soc.get_option().unwrap();
let is_set: bool = opt.get();

Methods

impl NoDelay
[src]

fn new(on: bool) -> NoDelay

fn get(&self) -> bool

fn set(&mut self, on: bool)

Trait Implementations

impl Clone for NoDelay
[src]

fn clone(&self) -> NoDelay

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Default for NoDelay
[src]

fn default() -> NoDelay

Returns the "default value" for a type. Read more

impl SocketOption<Tcp> for NoDelay
[src]

type Data = i32

fn level(&self, _: &Tcp) -> i32

fn name(&self, _: &Tcp) -> i32

impl GetSocketOption<Tcp> for NoDelay
[src]

fn data_mut(&mut self) -> &mut Self::Data

fn resize(&mut self, _size: usize)

impl SetSocketOption<Tcp> for NoDelay
[src]

fn data(&self) -> &Self::Data

fn size(&self) -> usize