Struct asio::socket_base::SendBufferSize [] [src]

pub struct SendBufferSize(_);

Socket option for the send buffer size of a socket.

Implements the SOL_SOCKET/SO_SNDBUF socket option.

Examples

Setting the option:

use asio::*;
use asio::ip::*;
use asio::socket_base::SendBufferSize;

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

soc.set_option(SendBufferSize::new(8192)).unwrap();

Getting the option:

use asio::*;
use asio::ip::*;
use asio::socket_base::SendBufferSize;

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

let opt: SendBufferSize = soc.get_option().unwrap();
let size: usize = opt.get();

Methods

impl SendBufferSize
[src]

fn new(size: usize) -> SendBufferSize

fn get(&self) -> usize

fn set(&mut self, size: usize)

Trait Implementations

impl Clone for SendBufferSize
[src]

fn clone(&self) -> SendBufferSize

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 SendBufferSize
[src]

fn default() -> SendBufferSize

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

impl<P: Protocol> SocketOption<P> for SendBufferSize
[src]

type Data = i32

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

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

impl<P: Protocol> GetSocketOption<P> for SendBufferSize
[src]

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

fn resize(&mut self, _size: usize)

impl<P: Protocol> SetSocketOption<P> for SendBufferSize
[src]

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

fn size(&self) -> usize