Struct asio::ip::TcpSocket [] [src]

pub struct TcpSocket {
    // some fields omitted
}

The TCP socket type.

Methods

impl TcpSocket
[src]

fn new(pro: Tcp) -> Result<Self>

Make the TCP socket.

Example

use asio::ip::{Tcp, TcpSocket};

// Make a TCP socket for IPv4.
let tcp4 = TcpSocket::new(Tcp::v4()).unwrap();

// Make a TCP socket for IPv6.
let tcp6 = TcpSocket::new(Tcp::v6()).unwrap();

Trait Implementations

impl AsRawFd for TcpSocket
[src]

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more

impl NonBlocking for TcpSocket
[src]

fn get_non_blocking(&self) -> bool

fn set_non_blocking(&self, on: bool)

fn native_get_non_blocking(&self) -> Result<bool>

fn native_set_non_blocking(&self, on: bool) -> Result<()>

impl Socket for TcpSocket
[src]

type Protocol = Tcp

type Endpoint = TcpEndpoint

fn bind(&self, ep: &Self::Endpoint) -> Result<()>

fn local_endpoint(&self) -> Result<Self::Endpoint>

fn io_control<T: IoControl<Self>>(&self, cmd: &mut T) -> Result<()>

fn get_option<T: GetSocketOption<Self>>(&self) -> Result<T>

fn set_option<T: SetSocketOption<Self>>(&self, cmd: &T) -> Result<()>

impl IpSocket for TcpSocket
[src]

impl Cancel for TcpSocket
[src]

fn cancel<A, T>(a: A, obj: &Strand<T>) where A: Fn(&T) -> &Self + 'static, T: 'static

impl SocketConnector for TcpSocket
[src]

fn connect<T: IoObject>(&self, io: &T, ep: &Self::Endpoint) -> Result<()>

fn async_connect<A, F, T>(a: A, ep: &Self::Endpoint, callback: F, obj: &Strand<T>) where A: Fn(&T) -> &Self + Send + 'static, F: FnOnce(Strand<T>, Result<()>) + Send + 'static, T: 'static

fn remote_endpoint(&self) -> Result<Self::Endpoint>

fn available(&self) -> Result<usize>

impl SendRecv for TcpSocket
[src]

fn recv<T: IoObject>(&self, io: &T, buf: &mut [u8], flags: i32) -> Result<usize>

fn async_recv<A, F, T>(a: A, flags: i32, callback: F, obj: &Strand<T>) where A: Fn(&mut T) -> (&Self, &mut [u8]) + Send + 'static, F: FnOnce(Strand<T>, Result<usize>) + Send + 'static, T: 'static

fn send<T: IoObject>(&self, io: &T, buf: &[u8], flags: i32) -> Result<usize>

fn async_send<A, F, T>(a: A, flags: i32, callback: F, obj: &Strand<T>) where A: Fn(&T) -> (&Self, &[u8]) + Send + 'static, F: FnOnce(Strand<T>, Result<usize>) + Send + 'static, T: 'static

impl ReadWrite for TcpSocket
[src]

fn read_some<T: IoObject>(&self, io: &T, buf: &mut [u8]) -> Result<usize>

fn async_read_some<A, F, T>(a: A, callback: F, obj: &Strand<T>) where A: Fn(&mut T) -> (&Self, &mut [u8]) + Send + 'static, F: FnOnce(Strand<T>, Result<usize>) + Send + 'static, T: 'static

fn write_some<T: IoObject>(&self, io: &T, buf: &[u8]) -> Result<usize>

fn async_write_some<A, F, T>(a: A, callback: F, obj: &Strand<T>) where A: Fn(&T) -> (&Self, &[u8]) + Send + 'static, F: FnOnce(Strand<T>, Result<usize>) + Send + 'static, T: 'static

fn async_read_until<A, C, F, T>(a: A, cond: C, callback: F, obj: &Strand<T>) where A: Fn(&mut T) -> (&Self, &mut StreamBuf) + Send + 'static, C: MatchCondition + Send + 'static, F: FnOnce(Strand<T>, Result<usize>) + Send + 'static, T: 'static

fn async_write_until<A, C, F, T>(a: A, cond: C, callback: F, obj: &Strand<T>) where A: Fn(&mut T) -> (&Self, &mut StreamBuf) + Send, C: MatchCondition + Send, F: FnOnce(Strand<T>, Result<usize>) + Send

impl StreamSocket for TcpSocket
[src]

fn shutdown(&self, how: Shutdown) -> Result<()>