Clementine
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
asio::ip::tcp Class Reference

Encapsulates the flags needed for TCP. More...

#include <tcp.hpp>

Public Types

typedef basic_endpoint< tcpendpoint
 The type of a TCP endpoint.
 
typedef basic_stream_socket< tcpsocket
 The TCP socket type.
 
typedef basic_socket_acceptor< tcpacceptor
 The TCP acceptor type.
 
typedef basic_resolver< tcpresolver
 The TCP resolver type.
 
typedef basic_socket_iostream< tcpiostream
 The TCP iostream type.
 
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(IPPROTO_TCP), ASIO_OS_DEF(TCP_NODELAY)> no_delay
 Socket option for disabling the Nagle algorithm. More...
 

Public Member Functions

int type () const ASIO_NOEXCEPT
 Obtain an identifier for the type of the protocol.
 
int protocol () const ASIO_NOEXCEPT
 Obtain an identifier for the protocol.
 
int family () const ASIO_NOEXCEPT
 Obtain an identifier for the protocol family.
 

Static Public Member Functions

static tcp v4 () ASIO_NOEXCEPT
 Construct to represent the IPv4 TCP protocol.
 
static tcp v6 () ASIO_NOEXCEPT
 Construct to represent the IPv6 TCP protocol.
 

Friends

bool operator== (const tcp &p1, const tcp &p2)
 Compare two protocols for equality.
 
bool operator!= (const tcp &p1, const tcp &p2)
 Compare two protocols for inequality.
 

Detailed Description

Encapsulates the flags needed for TCP.

The asio::ip::tcp class contains flags necessary for TCP sockets.

Thread Safety
Distinct objects: Safe.
Shared objects: Safe.
Concepts:
Protocol, InternetProtocol.

Member Typedef Documentation

◆ no_delay

typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(IPPROTO_TCP), ASIO_OS_DEF(TCP_NODELAY)> asio::ip::tcp::no_delay

Socket option for disabling the Nagle algorithm.

Implements the IPPROTO_TCP/TCP_NODELAY socket option.

Examples
Setting the option:
...
asio::ip::tcp::no_delay option(true);
socket.set_option(option);
Getting the current option value:
...
asio::ip::tcp::no_delay option;
socket.get_option(option);
bool is_set = option.value();
Concepts:
Socket_Option, Boolean_Socket_Option.

The documentation for this class was generated from the following file: