Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::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. More...
 
typedef basic_stream_socket< tcpsocket
 The TCP socket type. More...
 
typedef basic_socket_acceptor
< tcp
acceptor
 The TCP acceptor type. More...
 
typedef basic_resolver< tcpresolver
 The TCP resolver type. More...
 
typedef basic_socket_iostream
< tcp
iostream
 The TCP iostream type. More...
 
typedef
boost::asio::detail::socket_option::boolean
< BOOST_ASIO_OS_DEF(IPPROTO_TCP),
BOOST_ASIO_OS_DEF(TCP_NODELAY)> 
no_delay
 Socket option for disabling the Nagle algorithm. More...
 

Public Member Functions

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

Static Public Member Functions

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

Friends

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

Detailed Description

Encapsulates the flags needed for TCP.

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

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

Member Typedef Documentation

The TCP acceptor type.

The type of a TCP endpoint.

The TCP iostream type.

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

Socket option for disabling the Nagle algorithm.

Implements the IPPROTO_TCP/TCP_NODELAY socket option.

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

The TCP resolver type.

The TCP socket type.

Member Function Documentation

int boost::asio::ip::tcp::family ( ) const
inline

Obtain an identifier for the protocol family.

int boost::asio::ip::tcp::protocol ( ) const
inline

Obtain an identifier for the protocol.

int boost::asio::ip::tcp::type ( ) const
inline

Obtain an identifier for the type of the protocol.

static tcp boost::asio::ip::tcp::v4 ( )
inlinestatic

Construct to represent the IPv4 TCP protocol.

static tcp boost::asio::ip::tcp::v6 ( )
inlinestatic

Construct to represent the IPv6 TCP protocol.

Friends And Related Function Documentation

bool operator!= ( const tcp p1,
const tcp p2 
)
friend

Compare two protocols for inequality.

bool operator== ( const tcp p1,
const tcp p2 
)
friend

Compare two protocols for equality.


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