|---|---|
|
Default constructor. Construct with specified endpoint, host name and service name. |
|
|
Get the endpoint associated with the entry. |
|
|
Get the host name associated with the entry. |
|
|
Convert to the endpoint associated with the entry. |
|
|
Get the service name associated with the entry. |
The ip::basic_resolver_entry
class template describes an entry as returned by a resolver.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/basic_resolver_entry.hpp
Convenience header: boost/asio.hpp
basic_resolver_entry(); » more...
Construct with specified endpoint, host name and service name.
basic_resolver_entry( const endpoint_type & ep, const std::string & host, const std::string & service); » more...
Default constructor.
basic_resolver_entry();
Construct with specified endpoint, host name and service name.
basic_resolver_entry( const endpoint_type & ep, const std::string & host, const std::string & service);
The endpoint type associated with the endpoint entry.
typedef InternetProtocol::endpoint endpoint_type;
Header: boost/asio/ip/basic_resolver_entry.hpp
Convenience header: boost/asio.hpp
The protocol type associated with the endpoint entry.
typedef InternetProtocol protocol_type;
Header: boost/asio/ip/basic_resolver_entry.hpp
Convenience header: boost/asio.hpp
An iterator over the entries produced by a resolver.
template< typename InternetProtocol> class basic_resolver_iterator
|
Name |
Description |
|---|---|
|
The type used for the distance between two iterators. |
|
|
The iterator category. |
|
|
The type of the result of applying operator->() to the iterator. |
|
|
The type of the result of applying operator*() to the iterator. |
|
|
The type of the value pointed to by the iterator. |
|
Name |
Description |
|---|---|
|
Default constructor creates an end iterator. |
|
|
Create an iterator from an addrinfo list returned by getaddrinfo. Create an iterator from an endpoint, host name and service name. Create an iterator from a sequence of endpoints, host and service name. |
|
|
Dereference an iterator. |
|
|
Increment operator (prefix). Increment operator (postfix). |
|
|
Dereference an iterator. |
|
Name |
Description |
|---|---|
|
Test two iterators for inequality. |
|
|
Test two iterators for equality. |
The ip::basic_resolver_iterator
class template is used to define iterators over the results returned by a
resolver.
The iterator's value_type, obtained when the iterator is dereferenced, is:
const basic_resolver_entry<InternetProtocol>
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
Create an iterator from an addrinfo list returned by getaddrinfo.
static basic_resolver_iterator create( boost::asio::detail::addrinfo_type * address_info, const std::string & host_name, const std::string & service_name); » more...
Create an iterator from an endpoint, host name and service name.
static basic_resolver_iterator create( const typename InternetProtocol::endpoint & endpoint, const std::string & host_name, const std::string & service_name); » more...
Create an iterator from a sequence of endpoints, host and service name.
template< typename EndpointIterator> static basic_resolver_iterator create( EndpointIterator begin, EndpointIterator end, const std::string & host_name, const std::string & service_name); » more...
Create an iterator from an addrinfo list returned by getaddrinfo.
static basic_resolver_iterator create( boost::asio::detail::addrinfo_type * address_info, const std::string & host_name, const std::string & service_name);
Create an iterator from an endpoint, host name and service name.
static basic_resolver_iterator create( const typename InternetProtocol::endpoint & endpoint, const std::string & host_name, const std::string & service_name);
Create an iterator from a sequence of endpoints, host and service name.
template< typename EndpointIterator> static basic_resolver_iterator create( EndpointIterator begin, EndpointIterator end, const std::string & host_name, const std::string & service_name);
The type used for the distance between two iterators.
typedef std::ptrdiff_t difference_type;
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
typedef std::forward_iterator_tag iterator_category;
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
const basic_resolver_entry< InternetProtocol > & operator *() const;
Test two iterators for inequality.
friend bool operator!=( const basic_resolver_iterator & a, const basic_resolver_iterator & b);
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
basic_resolver_iterator & operator++(); » more...
Increment operator (postfix).
basic_resolver_iterator operator++( int ); » more...
Increment operator (prefix).
basic_resolver_iterator & operator++();
Increment operator (postfix).
basic_resolver_iterator operator++( int );
const basic_resolver_entry< InternetProtocol > * operator->() const;
Test two iterators for equality.
friend bool operator==( const basic_resolver_iterator & a, const basic_resolver_iterator & b);
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
The type of the result of applying operator->()
to the iterator.
typedef const basic_resolver_entry< InternetProtocol > * pointer;
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
The type of the result of applying
operator*()
to the iterator.
typedef const basic_resolver_entry< InternetProtocol > & reference;
|
Name |
Description |
|---|---|
|
The endpoint type associated with the endpoint entry. |
|
|
The protocol type associated with the endpoint entry. |
|
Name |
Description |
|---|---|
|
Default constructor. Construct with specified endpoint, host name and service name. |
|
|
Get the endpoint associated with the entry. |
|
|
Get the host name associated with the entry. |
|
|
Convert to the endpoint associated with the entry. |
|
|
Get the service name associated with the entry. |
The ip::basic_resolver_entry
class template
describes an entry as returned by a resolver.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
The type of the value pointed to by the iterator.
typedef basic_resolver_entry< InternetProtocol > value_type;
|
Name |
Description |
|---|---|
|
The endpoint type associated with the endpoint entry. |
|
|
The protocol type associated with the endpoint entry. |
|
Name |
Description |
|---|---|
|
Default constructor. Construct with specified endpoint, host name and service name. |
|
|
Get the endpoint associated with the entry. |
|
|
Get the host name associated with the entry. |
|
|
Convert to the endpoint associated with the entry. |
|
|
Get the service name associated with the entry. |
The ip::basic_resolver_entry
class template
describes an entry as returned by a resolver.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/basic_resolver_iterator.hpp
Convenience header: boost/asio.hpp
An query to be passed to a resolver.
template< typename InternetProtocol> class basic_resolver_query : public ip::resolver_query_base
|
Name |
Description |
|---|---|
|
A bitmask type (C++ Std [lib.bitmask.types]). |
|
|
The protocol type associated with the endpoint query. |
|
Name |
Description |
|---|---|
|
Construct with specified service name for any protocol. Construct with specified service name for a given protocol. Construct with specified host name and service name for any protocol. Construct with specified host name and service name for a given protocol. |
|
|
Get the hints associated with the query. |
|
|
Get the host name associated with the query. |
|
|
Get the service name associated with the query. |
|
Name |
Description |
|---|---|
|
Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. |
|
|
If used with v4_mapped, return all matching IPv6 and IPv4 addresses. |
|
|
Determine the canonical name of the host specified in the query. |
|
|
Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. |
|
|
Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. |
|
|
Indicate that returned endpoint is intended for use as a locally bound socket endpoint. |
|
|
If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. |
The ip::basic_resolver_query
class template describes a query that can be passed to a resolver.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/basic_resolver_query.hpp
Convenience header: boost/asio.hpp
Inherited from ip::resolver_query_base.
Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system.
static const flags address_configured = implementation_defined;
Inherited from ip::resolver_query_base.
If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
static const flags all_matching = implementation_defined;
Construct with specified service name for any protocol.
basic_resolver_query( const std::string & service, resolver_query_base::flags resolve_flags = passive|address_configured); » more...
Construct with specified service name for a given protocol.
basic_resolver_query( const protocol_type & protocol, const std::string & service, resolver_query_base::flags resolve_flags = passive|address_configured); » more...
Construct with specified host name and service name for any protocol.
basic_resolver_query( const std::string & host, const std::string & service, resolver_query_base::flags resolve_flags = address_configured); » more...
Construct with specified host name and service name for a given protocol.
basic_resolver_query( const protocol_type & protocol, const std::string & host, const std::string & service, resolver_query_base::flags resolve_flags = address_configured); » more...
Construct with specified service name for any protocol.
basic_resolver_query( const std::string & service, resolver_query_base::flags resolve_flags = passive|address_configured);
This constructor is typically used to perform name resolution for local service binding.
A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number.
A set of flags that determine how name resolution should be performed. The default flags are suitable for local service binding.
On POSIX systems, service names are typically defined in the file /etc/services
.
On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services
.
Operating systems may use additional locations when resolving service
names.
Construct with specified service name for a given protocol.
basic_resolver_query( const protocol_type & protocol, const std::string & service, resolver_query_base::flags resolve_flags = passive|address_configured);
This constructor is typically used to perform name resolution for local service binding with a specific protocol version.
A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.
A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number.
A set of flags that determine how name resolution should be performed. The default flags are suitable for local service binding.
On POSIX systems, service names are typically defined in the file /etc/services
.
On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services
.
Operating systems may use additional locations when resolving service
names.
Construct with specified host name and service name for any protocol.
basic_resolver_query( const std::string & host, const std::string & service, resolver_query_base::flags resolve_flags = address_configured);
This constructor is typically used to perform name resolution for communication with remote hosts.
A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.
A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.
A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.
On POSIX systems, host names may be locally defined in the file /etc/hosts
.
On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts
.
Remote host name resolution is performed using DNS. Operating systems
may use additional locations when resolving host names (such as NETBIOS
names on Windows).
On POSIX systems, service names are typically defined in the file /etc/services
.
On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services
.
Operating systems may use additional locations when resolving service
names.
Construct with specified host name and service name for a given protocol.
basic_resolver_query( const protocol_type & protocol, const std::string & host, const std::string & service, resolver_query_base::flags resolve_flags = address_configured);
This constructor is typically used to perform name resolution for communication with remote hosts.
A protocol object, normally representing either the IPv4 or IPv6 version of an internet protocol.
A string identifying a location. May be a descriptive name or a numeric address string. If an empty string and the passive flag has been specified, the resolved endpoints are suitable for local service binding. If an empty string and passive is not specified, the resolved endpoints will use the loopback address.
A string identifying the requested service. This may be a descriptive name or a numeric string corresponding to a port number. May be an empty string, in which case all resolved endpoints will have a port number of 0.
A set of flags that determine how name resolution should be performed. The default flags are suitable for communication with remote hosts.
On POSIX systems, host names may be locally defined in the file /etc/hosts
.
On Windows, host names may be defined in the file c:\windows\system32\drivers\etc\hosts
.
Remote host name resolution is performed using DNS. Operating systems
may use additional locations when resolving host names (such as NETBIOS
names on Windows).
On POSIX systems, service names are typically defined in the file /etc/services
.
On Windows, service names may be found in the file c:\windows\system32\drivers\etc\services
.
Operating systems may use additional locations when resolving service
names.
Inherited from ip::resolver_query_base.
Determine the canonical name of the host specified in the query.
static const flags canonical_name = implementation_defined;
Inherited from ip::resolver_query_base.
A bitmask type (C++ Std [lib.bitmask.types]).
typedef unspecified flags;
Header: boost/asio/ip/basic_resolver_query.hpp
Convenience header: boost/asio.hpp
Inherited from ip::resolver_query_base.
Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
static const flags numeric_host = implementation_defined;
Inherited from ip::resolver_query_base.
Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
static const flags numeric_service = implementation_defined;
Inherited from ip::resolver_query_base.
Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
static const flags passive = implementation_defined;
The protocol type associated with the endpoint query.
typedef InternetProtocol protocol_type;
Header: boost/asio/ip/basic_resolver_query.hpp
Convenience header: boost/asio.hpp
std::string host_name(); » more... std::string host_name( boost::system::error_code & ec); » more...
Header: boost/asio/ip/host_name.hpp
Convenience header: boost/asio.hpp
Get the current host name.
std::string host_name( boost::system::error_code & ec);
Encapsulates the flags needed for ICMP.
class icmp
|
Name |
Description |
|---|---|
|
The type of a ICMP endpoint. |
|
|
The ICMP resolver type. |
|
|
The ICMP socket type. |
|
Name |
Description |
|---|---|
|
Obtain an identifier for the protocol family. |
|
|
Obtain an identifier for the protocol. |
|
|
Obtain an identifier for the type of the protocol. |
|
|
Construct to represent the IPv4 ICMP protocol. |
|
|
Construct to represent the IPv6 ICMP protocol. |
|
Name |
Description |
|---|---|
|
Compare two protocols for inequality. |
|
|
Compare two protocols for equality. |
The ip::icmp
class contains flags necessary for ICMP sockets.
Distinct objects: Safe.
Shared objects: Safe.
Header: boost/asio/ip/icmp.hpp
Convenience header: boost/asio.hpp
typedef basic_endpoint< icmp > endpoint;
|
Name |
Description |
|---|---|
|
The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. |
|
|
The protocol type associated with the endpoint. |
|
Name |
Description |
|---|---|
|
Get the IP address associated with the endpoint. Set the IP address associated with the endpoint. |
|
|
Default constructor. Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections. Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.  The port number is always in the host's byte order. Set the port associated with the endpoint. The port number is always in the host's byte order. |
|
|
The protocol associated with the endpoint. |
|
|
Set the underlying size of the endpoint in the native type. |
|
|
Get the underlying size of the endpoint in the native type. |
|
Name |
Description |
|---|---|
|
Compare two endpoints for inequality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
|
Compare two endpoints for equality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
Name |
Description |
|---|---|
|
Output an endpoint as a string. |
The ip::basic_endpoint
class template
describes an endpoint that may be associated with a particular socket.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/icmp.hpp
Convenience header: boost/asio.hpp
Compare two protocols for inequality.
friend bool operator!=( const icmp & p1, const icmp & p2);
Header: boost/asio/ip/icmp.hpp
Convenience header: boost/asio.hpp
Compare two protocols for equality.
friend bool operator==( const icmp & p1, const icmp & p2);
Header: boost/asio/ip/icmp.hpp
Convenience header: boost/asio.hpp
typedef basic_resolver< icmp > resolver;
|
Name |
Description |
|---|---|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
The iterator type. |
|
|
The protocol type. |
|
|
The query type. |
|
|
The type of the service that will be used to provide I/O operations. |
|
Name |
Description |
|---|---|
|
Asynchronously perform forward resolution of a query to a list of entries. Asynchronously perform reverse resolution of an endpoint to a list of entries. |
|
|
Constructor. |
|
|
Cancel any asynchronous operations that are waiting on the resolver. |
|
|
Get the io_service associated with the object. |
|
|
Perform forward resolution of a query to a list of entries. Perform reverse resolution of an endpoint to a list of entries. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The ip::basic_resolver
class template
provides the ability to resolve a query to a list of endpoints.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/icmp.hpp
Convenience header: boost/asio.hpp
typedef basic_raw_socket< icmp > socket;
|
Name |
Description |
|---|---|
|
Socket option to permit sending of broadcast messages. |
|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
Socket option to enable socket-level debugging. |
|
|
Socket option to prevent routing, use local interfaces only. |
|
|
Socket option to report aborted connections on accept. |
|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
Socket option to send keep-alives. |
|
|
Socket option to specify whether the socket lingers on close if unsent data is present. |
|
|
A basic_socket is always the lowest layer. |
|
|
Bitmask type for flags that can be passed to send and receive operations. |
|
|
The native representation of a socket. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a socket. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. |
|
|
The protocol type. |
|
|
Socket option for the receive buffer size of a socket. |
|
|
Socket option for the receive low watermark. |
|
|
Socket option to allow the socket to be bound to an address that is already in use. |
|
|
Socket option for the send buffer size of a socket. |
|
|
Socket option for the send low watermark. |
|
|
The type of the service that will be used to provide I/O operations. |
|
|
Different ways a socket may be shutdown. |
|
Name |
Description |
|---|---|
|
Assign an existing native socket to the socket. |
|
|
Start an asynchronous connect. |
|
|
Start an asynchronous receive on a connected socket. |
|
|
Start an asynchronous receive. |
|
|
Start an asynchronous send on a connected socket. |
|
|
Start an asynchronous send. |
|
|
Determine whether the socket is at the out-of-band data mark. |
|
|
Determine the number of bytes available for reading. |
|
|
Construct a basic_raw_socket without opening it. Construct and open a basic_raw_socket. Construct a basic_raw_socket, opening it and binding it to the given local endpoint. Construct a basic_raw_socket on an existing native socket. Move-construct a basic_raw_socket from another.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native socket representation. |
|
|
Get the native socket representation. |
|
|
Gets the non-blocking mode of the native socket implementation. Sets the non-blocking mode of the native socket implementation. |
|
|
Gets the non-blocking mode of the socket. Sets the non-blocking mode of the socket. |
|
|
Open the socket using the specified protocol. |
|
|
Move-assign a basic_raw_socket from another. Move-assign a basic_raw_socket from a socket of another protocol type. |
|
|
Receive some data on a connected socket. |
|
|
Receive raw data with the endpoint of the sender. |
|
|
Get the remote endpoint of the socket. |
|
|
Send some data on a connected socket. |
|
|
Send raw data to the specified endpoint. |
|
|
Set an option on the socket. |
|
|
Disable sends or receives on the socket. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
The maximum length of the queue of pending incoming connections. |
|
|
Specify that the data should not be subject to routing. |
|
|
Specifies that the data marks the end of a record. |
|
|
Process out-of-band data. |
|
|
Peek at incoming data without removing it from the input queue. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The basic_raw_socket
class template
provides asynchronous and blocking raw-oriented socket functionality.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/icmp.hpp
Convenience header: boost/asio.hpp
Socket option determining whether outgoing multicast packets will be received on the same socket if it is a member of the multicast group.
typedef implementation_defined enable_loopback;
Implements the IPPROTO_IP/IP_MULTICAST_LOOP socket option.
Setting the option:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::multicast::enable_loopback option(true); socket.set_option(option);
Getting the current option value:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::multicast::enable_loopback option; socket.get_option(option); bool is_set = option.value();
Header: boost/asio/ip/multicast.hpp
Convenience header: boost/asio.hpp
Socket option for time-to-live associated with outgoing multicast packets.
typedef implementation_defined hops;
Implements the IPPROTO_IP/IP_MULTICAST_TTL socket option.
Setting the option:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::multicast::hops option(4); socket.set_option(option);
Getting the current option value:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::multicast::hops option; socket.get_option(option); int ttl = option.value();
Header: boost/asio/ip/multicast.hpp
Convenience header: boost/asio.hpp
Socket option to join a multicast group on a specified interface.
typedef implementation_defined join_group;
Implements the IPPROTO_IP/IP_ADD_MEMBERSHIP socket option.
Setting the option to join a multicast group:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::address multicast_address = boost::asio::ip::address::from_string("<IP_ADDRESS>"); boost::asio::ip::multicast::join_group option(multicast_address); socket.set_option(option);
Header: boost/asio/ip/multicast.hpp
Convenience header: boost/asio.hpp
Socket option to leave a multicast group on a specified interface.
typedef implementation_defined leave_group;
Implements the IPPROTO_IP/IP_DROP_MEMBERSHIP socket option.
Setting the option to leave a multicast group:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::address multicast_address = boost::asio::ip::address::from_string("<IP_ADDRESS>"); boost::asio::ip::multicast::leave_group option(multicast_address); socket.set_option(option);
Header: boost/asio/ip/multicast.hpp
Convenience header: boost/asio.hpp
Socket option for local interface to use for outgoing multicast packets.
typedef implementation_defined outbound_interface;
Implements the IPPROTO_IP/IP_MULTICAST_IF socket option.
Setting the option:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::address_v4 local_interface = boost::asio::ip::address_v4::from_string("<IP_ADDRESS>"); boost::asio::ip::multicast::outbound_interface option(local_interface); socket.set_option(option);
Header: boost/asio/ip/multicast.hpp
Convenience header: boost/asio.hpp
The ip::resolver_query_base
class is used as a base for the ip::basic_resolver_query
class templates to provide a common place to define the flag constants.
class resolver_query_base
|
Name |
Description |
|---|---|
|
A bitmask type (C++ Std [lib.bitmask.types]). |
|
Name |
Description |
|---|---|
|
Protected destructor to prevent deletion through this type. |
|
Name |
Description |
|---|---|
|
Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. |
|
|
If used with v4_mapped, return all matching IPv6 and IPv4 addresses. |
|
|
Determine the canonical name of the host specified in the query. |
|
|
Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. |
|
|
Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. |
|
|
Indicate that returned endpoint is intended for use as a locally bound socket endpoint. |
|
|
If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. |
Header: boost/asio/ip/resolver_query_base.hpp
Convenience header: boost/asio.hpp
Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system.
static const flags address_configured = implementation_defined;
If used with v4_mapped, return all matching IPv6 and IPv4 addresses.
static const flags all_matching = implementation_defined;
Determine the canonical name of the host specified in the query.
static const flags canonical_name = implementation_defined;
A bitmask type (C++ Std [lib.bitmask.types]).
typedef unspecified flags;
Header: boost/asio/ip/resolver_query_base.hpp
Convenience header: boost/asio.hpp
Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted.
static const flags numeric_host = implementation_defined;
Service name should be treated as a numeric string defining a port number and no name resolution should be attempted.
static const flags numeric_service = implementation_defined;
Indicate that returned endpoint is intended for use as a locally bound socket endpoint.
static const flags passive = implementation_defined;
If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses.
static const flags v4_mapped = implementation_defined;
Default service implementation for a resolver.
template< typename InternetProtocol> class resolver_service : public io_service::service
|
Name |
Description |
|---|---|
|
The endpoint type. |
|
|
The type of a resolver implementation. |
|
|
The iterator type. |
|
|
The protocol type. |
|
|
The query type. |
|
Name |
Description |
|---|---|
|
Asynchronously resolve a query to a list of entries. Asynchronously resolve an endpoint to a list of entries. |
|
|
Cancel pending asynchronous operations. |
|
|
Construct a new resolver implementation. |
|
|
Destroy a resolver implementation. |
|
|
Get the io_service object that owns the service. |
|
|
Resolve a query to a list of entries. Resolve an endpoint to a list of entries. |
|
|
Construct a new resolver service for the specified io_service. |
|
Name |
Description |
|---|---|
|
The unique service identifier. |
Header: boost/asio/ip/resolver_service.hpp
Convenience header: boost/asio.hpp
Asynchronously resolve a query to a list of entries.
template< typename ResolveHandler> void-or-deduced async_resolve( implementation_type & impl, const query_type & query, ResolveHandler handler); » more...
Asynchronously resolve an endpoint to a list of entries.
template< typename ResolveHandler> void-or-deduced async_resolve( implementation_type & impl, const endpoint_type & endpoint, ResolveHandler handler); » more...
Asynchronously resolve a query to a list of entries.
template< typename ResolveHandler> void-or-deduced async_resolve( implementation_type & impl, const query_type & query, ResolveHandler handler);
Asynchronously resolve an endpoint to a list of entries.
template< typename ResolveHandler> void-or-deduced async_resolve( implementation_type & impl, const endpoint_type & endpoint, ResolveHandler handler);
typedef InternetProtocol::endpoint endpoint_type;
Header: boost/asio/ip/resolver_service.hpp
Convenience header: boost/asio.hpp
Inherited from io_service.
Get the io_service
object that owns the
service.
boost::asio::io_service & get_io_service();
The type of a resolver implementation.
typedef implementation_defined implementation_type;
Header: boost/asio/ip/resolver_service.hpp
Convenience header: boost/asio.hpp
typedef basic_resolver_iterator< InternetProtocol > iterator_type;
|
Name |
Description |
|---|---|
|
The type used for the distance between two iterators. |
|
|
The iterator category. |
|
|
The type of the result of applying operator->() to the iterator. |
|
|
The type of the result of applying operator*() to the iterator. |
|
|
The type of the value pointed to by the iterator. |
|
Name |
Description |
|---|---|
|
Default constructor creates an end iterator. |
|
|
Create an iterator from an addrinfo list returned by getaddrinfo. Create an iterator from an endpoint, host name and service name. Create an iterator from a sequence of endpoints, host and service name. |
|
|
Dereference an iterator. |
|
|
Increment operator (prefix). Increment operator (postfix). |
|
|
Dereference an iterator. |
|
Name |
Description |
|---|---|
|
Test two iterators for inequality. |
|
|
Test two iterators for equality. |
The ip::basic_resolver_iterator
class
template is used to define iterators over the results returned by a resolver.
The iterator's value_type, obtained when the iterator is dereferenced, is:
const basic_resolver_entry<InternetProtocol>
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/resolver_service.hpp
Convenience header: boost/asio.hpp
typedef InternetProtocol protocol_type;
Header: boost/asio/ip/resolver_service.hpp
Convenience header: boost/asio.hpp
typedef basic_resolver_query< InternetProtocol > query_type;
|
Name |
Description |
|---|---|
|
A bitmask type (C++ Std [lib.bitmask.types]). |
|
|
The protocol type associated with the endpoint query. |
|
Name |
Description |
|---|---|
|
Construct with specified service name for any protocol. Construct with specified service name for a given protocol. Construct with specified host name and service name for any protocol. Construct with specified host name and service name for a given protocol. |
|
|
Get the hints associated with the query. |
|
|
Get the host name associated with the query. |
|
|
Get the service name associated with the query. |
|
Name |
Description |
|---|---|
|
Only return IPv4 addresses if a non-loopback IPv4 address is configured for the system. Only return IPv6 addresses if a non-loopback IPv6 address is configured for the system. |
|
|
If used with v4_mapped, return all matching IPv6 and IPv4 addresses. |
|
|
Determine the canonical name of the host specified in the query. |
|
|
Host name should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. |
|
|
Service name should be treated as a numeric string defining a port number and no name resolution should be attempted. |
|
|
Indicate that returned endpoint is intended for use as a locally bound socket endpoint. |
|
|
If the query protocol family is specified as IPv6, return IPv4-mapped IPv6 addresses on finding no IPv6 addresses. |
The ip::basic_resolver_query
class template
describes a query that can be passed to a resolver.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/resolver_service.hpp
Convenience header: boost/asio.hpp
Resolve a query to a list of entries.
iterator_type resolve( implementation_type & impl, const query_type & query, boost::system::error_code & ec); » more...
Resolve an endpoint to a list of entries.
iterator_type resolve( implementation_type & impl, const endpoint_type & endpoint, boost::system::error_code & ec); » more...
Resolve a query to a list of entries.
iterator_type resolve( implementation_type & impl, const query_type & query, boost::system::error_code & ec);
Resolve an endpoint to a list of entries.
iterator_type resolve( implementation_type & impl, const endpoint_type & endpoint, boost::system::error_code & ec);
Construct a new resolver service for
the specified io_service
.
resolver_service( boost::asio::io_service & io_service);
Encapsulates the flags needed for TCP.
class tcp
|
Name |
Description |
|---|---|
|
The TCP acceptor type. |
|
|
The type of a TCP endpoint. |
|
|
The TCP iostream type. |
|
|
Socket option for disabling the Nagle algorithm. |
|
|
The TCP resolver type. |
|
|
The TCP socket type. |
|
Name |
Description |
|---|---|
|
Obtain an identifier for the protocol family. |
|
|
Obtain an identifier for the protocol. |
|
|
Obtain an identifier for the type of the protocol. |
|
|
Construct to represent the IPv4 TCP protocol. |
|
|
Construct to represent the IPv6 TCP protocol. |
|
Name |
Description |
|---|---|
|
Compare two protocols for inequality. |
|
|
Compare two protocols for equality. |
The ip::tcp
class contains flags necessary for TCP sockets.
Distinct objects: Safe.
Shared objects: Safe.
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
typedef basic_socket_acceptor< tcp > acceptor;
|
Name |
Description |
|---|---|
|
Socket option to permit sending of broadcast messages. |
|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
Socket option to enable socket-level debugging. |
|
|
Socket option to prevent routing, use local interfaces only. |
|
|
Socket option to report aborted connections on accept. |
|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
Socket option to send keep-alives. |
|
|
Socket option to specify whether the socket lingers on close if unsent data is present. |
|
|
Bitmask type for flags that can be passed to send and receive operations. |
|
|
The native representation of an acceptor. |
|
|
(Deprecated: Use native_handle_type.) The native representation of an acceptor. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. |
|
|
The protocol type. |
|
|
Socket option for the receive buffer size of a socket. |
|
|
Socket option for the receive low watermark. |
|
|
Socket option to allow the socket to be bound to an address that is already in use. |
|
|
Socket option for the send buffer size of a socket. |
|
|
Socket option for the send low watermark. |
|
|
The type of the service that will be used to provide I/O operations. |
|
|
Different ways a socket may be shutdown. |
|
Name |
Description |
|---|---|
|
Accept a new connection. Accept a new connection and obtain the endpoint of the peer. |
|
|
Assigns an existing native acceptor to the acceptor. |
|
|
Start an asynchronous accept. |
|
|
Construct an acceptor without opening it. Construct an open acceptor. Construct an acceptor opened on the given endpoint. Construct a basic_socket_acceptor on an existing native acceptor. Move-construct a basic_socket_acceptor from another. Move-construct a basic_socket_acceptor from an acceptor of another protocol type. |
|
|
Bind the acceptor to the given local endpoint. |
|
|
Cancel all asynchronous operations associated with the acceptor. |
|
|
Close the acceptor. |
|
|
Get the io_service associated with the object. |
|
|
Get an option from the acceptor. |
|
|
Perform an IO control command on the acceptor. |
|
|
Determine whether the acceptor is open. |
|
|
Place the acceptor into the state where it will listen for new connections. |
|
|
Get the local endpoint of the acceptor. |
|
|
(Deprecated: Use native_handle().) Get the native acceptor representation. |
|
|
Get the native acceptor representation. |
|
|
Gets the non-blocking mode of the native acceptor implementation. Sets the non-blocking mode of the native acceptor implementation. |
|
|
Gets the non-blocking mode of the acceptor. Sets the non-blocking mode of the acceptor. |
|
|
Open the acceptor using the specified protocol. |
|
|
Move-assign a basic_socket_acceptor from another. Move-assign a basic_socket_acceptor from an acceptor of another protocol type. |
|
|
Set an option on the acceptor. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
The maximum length of the queue of pending incoming connections. |
|
|
Specify that the data should not be subject to routing. |
|
|
Specifies that the data marks the end of a record. |
|
|
Process out-of-band data. |
|
|
Peek at incoming data without removing it from the input queue. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The basic_socket_acceptor
class template
is used for accepting new socket connections.
Distinct objects: Safe.
Shared objects: Unsafe.
Opening a socket acceptor with the SO_REUSEADDR option enabled:
boost::asio::ip::tcp::acceptor acceptor(io_service); boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port); acceptor.open(endpoint.protocol()); acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); acceptor.bind(endpoint); acceptor.listen();
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
typedef basic_endpoint< tcp > endpoint;
|
Name |
Description |
|---|---|
|
The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. |
|
|
The protocol type associated with the endpoint. |
|
Name |
Description |
|---|---|
|
Get the IP address associated with the endpoint. Set the IP address associated with the endpoint. |
|
|
Default constructor. Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections. Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.  The port number is always in the host's byte order. Set the port associated with the endpoint. The port number is always in the host's byte order. |
|
|
The protocol associated with the endpoint. |
|
|
Set the underlying size of the endpoint in the native type. |
|
|
Get the underlying size of the endpoint in the native type. |
|
Name |
Description |
|---|---|
|
Compare two endpoints for inequality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
|
Compare two endpoints for equality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
Name |
Description |
|---|---|
|
Output an endpoint as a string. |
The ip::basic_endpoint
class template
describes an endpoint that may be associated with a particular socket.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
typedef basic_socket_iostream< tcp > iostream;
|
Name |
Description |
|---|---|
|
The duration type. |
|
|
The endpoint type. |
|
|
The time type. |
|
Name |
Description |
|---|---|
|
Construct a basic_socket_iostream without establishing a connection.  Set the stream's expiry time as an absolute time. |
|
|
Get the timer's expiry time relative to now. Set the stream's expiry time relative to now. |
|
|
Return a pointer to the underlying streambuf. |
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
Socket option for disabling the Nagle algorithm.
typedef implementation_defined no_delay;
Implements the IPPROTO_TCP/TCP_NODELAY socket option.
Setting the option:
boost::asio::ip::tcp::socket socket(io_service); ... boost::asio::ip::tcp::no_delay option(true); socket.set_option(option);
Getting the current option value:
boost::asio::ip::tcp::socket socket(io_service); ... boost::asio::ip::tcp::no_delay option; socket.get_option(option); bool is_set = option.value();
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
Compare two protocols for inequality.
friend bool operator!=( const tcp & p1, const tcp & p2);
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
Compare two protocols for equality.
friend bool operator==( const tcp & p1, const tcp & p2);
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
typedef basic_resolver< tcp > resolver;
|
Name |
Description |
|---|---|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
The iterator type. |
|
|
The protocol type. |
|
|
The query type. |
|
|
The type of the service that will be used to provide I/O operations. |
|
Name |
Description |
|---|---|
|
Asynchronously perform forward resolution of a query to a list of entries. Asynchronously perform reverse resolution of an endpoint to a list of entries. |
|
|
Constructor. |
|
|
Cancel any asynchronous operations that are waiting on the resolver. |
|
|
Get the io_service associated with the object. |
|
|
Perform forward resolution of a query to a list of entries. Perform reverse resolution of an endpoint to a list of entries. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The ip::basic_resolver
class template
provides the ability to resolve a query to a list of endpoints.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
typedef basic_stream_socket< tcp > socket;
|
Name |
Description |
|---|---|
|
Socket option to permit sending of broadcast messages. |
|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
Socket option to enable socket-level debugging. |
|
|
Socket option to prevent routing, use local interfaces only. |
|
|
Socket option to report aborted connections on accept. |
|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
Socket option to send keep-alives. |
|
|
Socket option to specify whether the socket lingers on close if unsent data is present. |
|
|
A basic_socket is always the lowest layer. |
|
|
Bitmask type for flags that can be passed to send and receive operations. |
|
|
The native representation of a socket. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a socket. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. |
|
|
The protocol type. |
|
|
Socket option for the receive buffer size of a socket. |
|
|
Socket option for the receive low watermark. |
|
|
Socket option to allow the socket to be bound to an address that is already in use. |
|
|
Socket option for the send buffer size of a socket. |
|
|
Socket option for the send low watermark. |
|
|
The type of the service that will be used to provide I/O operations. |
|
|
Different ways a socket may be shutdown. |
|
Name |
Description |
|---|---|
|
Assign an existing native socket to the socket. |
|
|
Start an asynchronous connect. |
|
|
Start an asynchronous read. |
|
|
Start an asynchronous receive. |
|
|
Start an asynchronous send. |
|
|
Start an asynchronous write. |
|
|
Determine whether the socket is at the out-of-band data mark. |
|
|
Determine the number of bytes available for reading. |
|
|
Construct a basic_stream_socket without opening it. Construct and open a basic_stream_socket. Construct a basic_stream_socket, opening it and binding it to the given local endpoint. Construct a basic_stream_socket on an existing native socket. Move-construct a basic_stream_socket from another.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native socket representation. |
|
|
Get the native socket representation. |
|
|
Gets the non-blocking mode of the native socket implementation. Sets the non-blocking mode of the native socket implementation. |
|
|
Gets the non-blocking mode of the socket. Sets the non-blocking mode of the socket. |
|
|
Open the socket using the specified protocol. |
|
|
Move-assign a basic_stream_socket from another. Move-assign a basic_stream_socket from a socket of another protocol type. |
|
|
Read some data from the socket. |
|
|
Receive some data on the socket. Receive some data on a connected socket. |
|
|
Get the remote endpoint of the socket. |
|
|
Send some data on the socket. |
|
|
Set an option on the socket. |
|
|
Disable sends or receives on the socket. |
|
|
Write some data to the socket. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
The maximum length of the queue of pending incoming connections. |
|
|
Specify that the data should not be subject to routing. |
|
|
Specifies that the data marks the end of a record. |
|
|
Process out-of-band data. |
|
|
Peek at incoming data without removing it from the input queue. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The basic_stream_socket
class template
provides asynchronous and blocking stream-oriented socket functionality.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/tcp.hpp
Convenience header: boost/asio.hpp
Encapsulates the flags needed for UDP.
class udp
|
Name |
Description |
|---|---|
|
The type of a UDP endpoint. |
|
|
The UDP resolver type. |
|
|
The UDP socket type. |
|
Name |
Description |
|---|---|
|
Obtain an identifier for the protocol family. |
|
|
Obtain an identifier for the protocol. |
|
|
Obtain an identifier for the type of the protocol. |
|
|
Construct to represent the IPv4 UDP protocol. |
|
|
Construct to represent the IPv6 UDP protocol. |
|
Name |
Description |
|---|---|
|
Compare two protocols for inequality. |
|
|
Compare two protocols for equality. |
The ip::udp
class contains flags necessary for UDP sockets.
Distinct objects: Safe.
Shared objects: Safe.
Header: boost/asio/ip/udp.hpp
Convenience header: boost/asio.hpp
typedef basic_endpoint< udp > endpoint;
|
Name |
Description |
|---|---|
|
The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. |
|
|
The protocol type associated with the endpoint. |
|
Name |
Description |
|---|---|
|
Get the IP address associated with the endpoint. Set the IP address associated with the endpoint. |
|
|
Default constructor. Construct an endpoint using a port number, specified in the host's byte order. The IP address will be the any address (i.e. INADDR_ANY or in6addr_any). This constructor would typically be used for accepting new connections. Construct an endpoint using a port number and an IP address. This constructor may be used for accepting connections on a specific interface or for making a connection to a remote endpoint.  The port number is always in the host's byte order. Set the port associated with the endpoint. The port number is always in the host's byte order. |
|
|
The protocol associated with the endpoint. |
|
|
Set the underlying size of the endpoint in the native type. |
|
|
Get the underlying size of the endpoint in the native type. |
|
Name |
Description |
|---|---|
|
Compare two endpoints for inequality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
|
Compare two endpoints for equality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
Name |
Description |
|---|---|
|
Output an endpoint as a string. |
The ip::basic_endpoint
class template
describes an endpoint that may be associated with a particular socket.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/udp.hpp
Convenience header: boost/asio.hpp
Compare two protocols for inequality.
friend bool operator!=( const udp & p1, const udp & p2);
Header: boost/asio/ip/udp.hpp
Convenience header: boost/asio.hpp
Compare two protocols for equality.
friend bool operator==( const udp & p1, const udp & p2);
Header: boost/asio/ip/udp.hpp
Convenience header: boost/asio.hpp
typedef basic_resolver< udp > resolver;
|
Name |
Description |
|---|---|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
The iterator type. |
|
|
The protocol type. |
|
|
The query type. |
|
|
The type of the service that will be used to provide I/O operations. |
|
Name |
Description |
|---|---|
|
Asynchronously perform forward resolution of a query to a list of entries. Asynchronously perform reverse resolution of an endpoint to a list of entries. |
|
|
Constructor. |
|
|
Cancel any asynchronous operations that are waiting on the resolver. |
|
|
Get the io_service associated with the object. |
|
|
Perform forward resolution of a query to a list of entries. Perform reverse resolution of an endpoint to a list of entries. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The ip::basic_resolver
class template
provides the ability to resolve a query to a list of endpoints.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/udp.hpp
Convenience header: boost/asio.hpp
typedef basic_datagram_socket< udp > socket;
|
Name |
Description |
|---|---|
|
Socket option to permit sending of broadcast messages. |
|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
Socket option to enable socket-level debugging. |
|
|
Socket option to prevent routing, use local interfaces only. |
|
|
Socket option to report aborted connections on accept. |
|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
Socket option to send keep-alives. |
|
|
Socket option to specify whether the socket lingers on close if unsent data is present. |
|
|
A basic_socket is always the lowest layer. |
|
|
Bitmask type for flags that can be passed to send and receive operations. |
|
|
The native representation of a socket. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a socket. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. |
|
|
The protocol type. |
|
|
Socket option for the receive buffer size of a socket. |
|
|
Socket option for the receive low watermark. |
|
|
Socket option to allow the socket to be bound to an address that is already in use. |
|
|
Socket option for the send buffer size of a socket. |
|
|
Socket option for the send low watermark. |
|
|
The type of the service that will be used to provide I/O operations. |
|
|
Different ways a socket may be shutdown. |
|
Name |
Description |
|---|---|
|
Assign an existing native socket to the socket. |
|
|
Start an asynchronous connect. |
|
|
Start an asynchronous receive on a connected socket. |
|
|
Start an asynchronous receive. |
|
|
Start an asynchronous send on a connected socket. |
|
|
Start an asynchronous send. |
|
|
Determine whether the socket is at the out-of-band data mark. |
|
|
Determine the number of bytes available for reading. |
|
|
Construct a basic_datagram_socket without opening it. Construct and open a basic_datagram_socket. Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. Construct a basic_datagram_socket on an existing native socket. Move-construct a basic_datagram_socket from another.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native socket representation. |
|
|
Get the native socket representation. |
|
|
Gets the non-blocking mode of the native socket implementation. Sets the non-blocking mode of the native socket implementation. |
|
|
Gets the non-blocking mode of the socket. Sets the non-blocking mode of the socket. |
|
|
Open the socket using the specified protocol. |
|
|
Move-assign a basic_datagram_socket from another. Move-assign a basic_datagram_socket from a socket of another protocol type. |
|
|
Receive some data on a connected socket. |
|
|
Receive a datagram with the endpoint of the sender. |
|
|
Get the remote endpoint of the socket. |
|
|
Send some data on a connected socket. |
|
|
Send a datagram to the specified endpoint. |
|
|
Set an option on the socket. |
|
|
Disable sends or receives on the socket. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
The maximum length of the queue of pending incoming connections. |
|
|
Specify that the data should not be subject to routing. |
|
|
Specifies that the data marks the end of a record. |
|
|
Process out-of-band data. |
|
|
Peek at incoming data without removing it from the input queue. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The basic_datagram_socket
class template
provides asynchronous and blocking datagram-oriented socket functionality.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/ip/udp.hpp
Convenience header: boost/asio.hpp
Socket option for time-to-live associated with outgoing unicast packets.
typedef implementation_defined hops;
Implements the IPPROTO_IP/IP_UNICAST_TTL socket option.
Setting the option:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::unicast::hops option(4); socket.set_option(option);
Getting the current option value:
boost::asio::ip::udp::socket socket(io_service); ... boost::asio::ip::unicast::hops option; socket.get_option(option); int ttl = option.value();
Header: boost/asio/ip/unicast.hpp
Convenience header: boost/asio.hpp
Socket option for determining whether an IPv6 socket supports IPv6 communication only.
typedef implementation_defined v6_only;
Implements the IPPROTO_IPV6/IP_V6ONLY socket option.
Setting the option:
boost::asio::ip::tcp::socket socket(io_service); ... boost::asio::ip::v6_only option(true); socket.set_option(option);
Getting the current option value:
boost::asio::ip::tcp::socket socket(io_service); ... boost::asio::ip::v6_only option; socket.get_option(option); bool v6_only = option.value();
Header: boost/asio/ip/v6_only.hpp
Convenience header: boost/asio.hpp
Type trait used to determine whether a type can be used as a match condition function with read_until and async_read_until.
template< typename T> struct is_match_condition
|
Name |
Description |
|---|---|
|
The value member is true if the type may be used as a match condition. |
Header: boost/asio/read_until.hpp
Convenience header: boost/asio.hpp
The is_read_buffered
class is a traits class that may be used to determine whether a stream type
supports buffering of read data.
template< typename Stream> class is_read_buffered
|
Name |
Description |
|---|---|
|
The value member is true only if the Stream type supports buffering of read data. |
Header: boost/asio/is_read_buffered.hpp
Convenience header: boost/asio.hpp
The is_write_buffered
class is a traits
class that may be used to determine whether a stream type supports buffering
of written data.
template< typename Stream> class is_write_buffered
|
Name |
Description |
|---|---|
|
The value member is true only if the Stream type supports buffering of written data. |
Header: boost/asio/is_write_buffered.hpp
Convenience header: boost/asio.hpp
Describes an endpoint for a UNIX socket.
template< typename Protocol> class basic_endpoint
|
Name |
Description |
|---|---|
|
The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. |
|
|
The protocol type associated with the endpoint. |
|
Name |
Description |
|---|---|
|
Default constructor. Construct an endpoint using the specified path name.  Set the path associated with the endpoint. |
|
|
The protocol associated with the endpoint. |
|
|
Set the underlying size of the endpoint in the native type. |
|
|
Get the underlying size of the endpoint in the native type. |
|
Name |
Description |
|---|---|
|
Compare two endpoints for inequality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
|
Compare two endpoints for equality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
Name |
Description |
|---|---|
|
Output an endpoint as a string. |
The local::basic_endpoint
class template describes
an endpoint that may be associated with a particular UNIX socket.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
basic_endpoint(); » more...
Construct an endpoint using the specified path name.
basic_endpoint( const char * path_name); » more... basic_endpoint( const std::string & path_name); » more...
Copy constructor.
basic_endpoint( const basic_endpoint & other); » more...
Construct an endpoint using the specified path name.
basic_endpoint( const char * path_name);
Construct an endpoint using the specified path name.
basic_endpoint( const std::string & path_name);
Copy constructor.
basic_endpoint( const basic_endpoint & other);
Get the underlying endpoint in the native type.
data_type * data(); » more... const data_type * data() const; » more...
Get the underlying endpoint in the native type.
data_type * data();
Get the underlying endpoint in the native type.
const data_type * data() const;
The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer.
typedef implementation_defined data_type;
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
Compare two endpoints for inequality.
friend bool operator!=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2);
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
Compare endpoints for ordering.
friend bool operator<( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2);
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
Output an endpoint as a string.
std::basic_ostream< Elem, Traits > & operator<<( std::basic_ostream< Elem, Traits > & os, const basic_endpoint< Protocol > & endpoint);
Used to output a human-readable string for a specified endpoint.
The output stream to which the string will be written.
The endpoint to be written.
The output stream.
Compare endpoints for ordering.
friend bool operator<=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2);
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
basic_endpoint & operator=( const basic_endpoint & other);
Compare two endpoints for equality.
friend bool operator==( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2);
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
Compare endpoints for ordering.
friend bool operator>( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2);
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
Compare endpoints for ordering.
friend bool operator>=( const basic_endpoint< Protocol > & e1, const basic_endpoint< Protocol > & e2);
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
Get the path associated with the endpoint.
std::string path() const; » more...
Set the path associated with the endpoint.
void path( const char * p); » more... void path( const std::string & p); » more...
Get the path associated with the endpoint.
std::string path() const;
Set the path associated with the endpoint.
void path( const char * p);
Set the path associated with the endpoint.
void path( const std::string & p);
The protocol type associated with the endpoint.
typedef Protocol protocol_type;
Header: boost/asio/local/basic_endpoint.hpp
Convenience header: boost/asio.hpp
Create a pair of connected sockets.
template< typename Protocol, typename SocketService1, typename SocketService2> void connect_pair( basic_socket< Protocol, SocketService1 > & socket1, basic_socket< Protocol, SocketService2 > & socket2); » more... template< typename Protocol, typename SocketService1, typename SocketService2> boost::system::error_code connect_pair( basic_socket< Protocol, SocketService1 > & socket1, basic_socket< Protocol, SocketService2 > & socket2, boost::system::error_code & ec); » more...
Header: boost/asio/local/connect_pair.hpp
Convenience header: boost/asio.hpp
Create a pair of connected sockets.
template< typename Protocol, typename SocketService1, typename SocketService2> void connect_pair( basic_socket< Protocol, SocketService1 > & socket1, basic_socket< Protocol, SocketService2 > & socket2);
Create a pair of connected sockets.
template< typename Protocol, typename SocketService1, typename SocketService2> boost::system::error_code connect_pair( basic_socket< Protocol, SocketService1 > & socket1, basic_socket< Protocol, SocketService2 > & socket2, boost::system::error_code & ec);
Encapsulates the flags needed for datagram-oriented UNIX sockets.
class datagram_protocol
|
Name |
Description |
|---|---|
|
Obtain an identifier for the protocol family. |
|
|
Obtain an identifier for the protocol. |
|
|
Obtain an identifier for the type of the protocol. |
The local::datagram_protocol
class contains
flags necessary for datagram-oriented UNIX domain sockets.
Distinct objects: Safe.
Shared objects: Safe.
Header: boost/asio/local/datagram_protocol.hpp
Convenience header: boost/asio.hpp
The type of a UNIX domain endpoint.
typedef basic_endpoint< datagram_protocol > endpoint;
|
Name |
Description |
|---|---|
|
The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. |
|
|
The protocol type associated with the endpoint. |
|
Name |
Description |
|---|---|
|
Default constructor. Construct an endpoint using the specified path name.  Set the path associated with the endpoint. |
|
|
The protocol associated with the endpoint. |
|
|
Set the underlying size of the endpoint in the native type. |
|
|
Get the underlying size of the endpoint in the native type. |
|
Name |
Description |
|---|---|
|
Compare two endpoints for inequality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
|
Compare two endpoints for equality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
Name |
Description |
|---|---|
|
Output an endpoint as a string. |
The local::basic_endpoint
class template
describes an endpoint that may be associated with a particular UNIX socket.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/local/datagram_protocol.hpp
Convenience header: boost/asio.hpp
typedef basic_datagram_socket< datagram_protocol > socket;
|
Name |
Description |
|---|---|
|
Socket option to permit sending of broadcast messages. |
|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
Socket option to enable socket-level debugging. |
|
|
Socket option to prevent routing, use local interfaces only. |
|
|
Socket option to report aborted connections on accept. |
|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
Socket option to send keep-alives. |
|
|
Socket option to specify whether the socket lingers on close if unsent data is present. |
|
|
A basic_socket is always the lowest layer. |
|
|
Bitmask type for flags that can be passed to send and receive operations. |
|
|
The native representation of a socket. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a socket. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. |
|
|
The protocol type. |
|
|
Socket option for the receive buffer size of a socket. |
|
|
Socket option for the receive low watermark. |
|
|
Socket option to allow the socket to be bound to an address that is already in use. |
|
|
Socket option for the send buffer size of a socket. |
|
|
Socket option for the send low watermark. |
|
|
The type of the service that will be used to provide I/O operations. |
|
|
Different ways a socket may be shutdown. |
|
Name |
Description |
|---|---|
|
Assign an existing native socket to the socket. |
|
|
Start an asynchronous connect. |
|
|
Start an asynchronous receive on a connected socket. |
|
|
Start an asynchronous receive. |
|
|
Start an asynchronous send on a connected socket. |
|
|
Start an asynchronous send. |
|
|
Determine whether the socket is at the out-of-band data mark. |
|
|
Determine the number of bytes available for reading. |
|
|
Construct a basic_datagram_socket without opening it. Construct and open a basic_datagram_socket. Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. Construct a basic_datagram_socket on an existing native socket. Move-construct a basic_datagram_socket from another.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native socket representation. |
|
|
Get the native socket representation. |
|
|
Gets the non-blocking mode of the native socket implementation. Sets the non-blocking mode of the native socket implementation. |
|
|
Gets the non-blocking mode of the socket. Sets the non-blocking mode of the socket. |
|
|
Open the socket using the specified protocol. |
|
|
Move-assign a basic_datagram_socket from another. Move-assign a basic_datagram_socket from a socket of another protocol type. |
|
|
Receive some data on a connected socket. |
|
|
Receive a datagram with the endpoint of the sender. |
|
|
Get the remote endpoint of the socket. |
|
|
Send some data on a connected socket. |
|
|
Send a datagram to the specified endpoint. |
|
|
Set an option on the socket. |
|
|
Disable sends or receives on the socket. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
The maximum length of the queue of pending incoming connections. |
|
|
Specify that the data should not be subject to routing. |
|
|
Specifies that the data marks the end of a record. |
|
|
Process out-of-band data. |
|
|
Peek at incoming data without removing it from the input queue. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The basic_datagram_socket
class template
provides asynchronous and blocking datagram-oriented socket functionality.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/local/datagram_protocol.hpp
Convenience header: boost/asio.hpp
Encapsulates the flags needed for stream-oriented UNIX sockets.
class stream_protocol
|
Name |
Description |
|---|---|
|
The UNIX domain acceptor type. |
|
|
The type of a UNIX domain endpoint. |
|
|
The UNIX domain iostream type. |
|
|
The UNIX domain socket type. |
|
Name |
Description |
|---|---|
|
Obtain an identifier for the protocol family. |
|
|
Obtain an identifier for the protocol. |
|
|
Obtain an identifier for the type of the protocol. |
The local::stream_protocol
class contains flags
necessary for stream-oriented UNIX domain sockets.
Distinct objects: Safe.
Shared objects: Safe.
Header: boost/asio/local/stream_protocol.hpp
Convenience header: boost/asio.hpp
The UNIX domain acceptor type.
typedef basic_socket_acceptor< stream_protocol > acceptor;
|
Name |
Description |
|---|---|
|
Socket option to permit sending of broadcast messages. |
|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
Socket option to enable socket-level debugging. |
|
|
Socket option to prevent routing, use local interfaces only. |
|
|
Socket option to report aborted connections on accept. |
|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
Socket option to send keep-alives. |
|
|
Socket option to specify whether the socket lingers on close if unsent data is present. |
|
|
Bitmask type for flags that can be passed to send and receive operations. |
|
|
The native representation of an acceptor. |
|
|
(Deprecated: Use native_handle_type.) The native representation of an acceptor. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. |
|
|
The protocol type. |
|
|
Socket option for the receive buffer size of a socket. |
|
|
Socket option for the receive low watermark. |
|
|
Socket option to allow the socket to be bound to an address that is already in use. |
|
|
Socket option for the send buffer size of a socket. |
|
|
Socket option for the send low watermark. |
|
|
The type of the service that will be used to provide I/O operations. |
|
|
Different ways a socket may be shutdown. |
|
Name |
Description |
|---|---|
|
Accept a new connection. Accept a new connection and obtain the endpoint of the peer. |
|
|
Assigns an existing native acceptor to the acceptor. |
|
|
Start an asynchronous accept. |
|
|
Construct an acceptor without opening it. Construct an open acceptor. Construct an acceptor opened on the given endpoint. Construct a basic_socket_acceptor on an existing native acceptor. Move-construct a basic_socket_acceptor from another. Move-construct a basic_socket_acceptor from an acceptor of another protocol type. |
|
|
Bind the acceptor to the given local endpoint. |
|
|
Cancel all asynchronous operations associated with the acceptor. |
|
|
Close the acceptor. |
|
|
Get the io_service associated with the object. |
|
|
Get an option from the acceptor. |
|
|
Perform an IO control command on the acceptor. |
|
|
Determine whether the acceptor is open. |
|
|
Place the acceptor into the state where it will listen for new connections. |
|
|
Get the local endpoint of the acceptor. |
|
|
(Deprecated: Use native_handle().) Get the native acceptor representation. |
|
|
Get the native acceptor representation. |
|
|
Gets the non-blocking mode of the native acceptor implementation. Sets the non-blocking mode of the native acceptor implementation. |
|
|
Gets the non-blocking mode of the acceptor. Sets the non-blocking mode of the acceptor. |
|
|
Open the acceptor using the specified protocol. |
|
|
Move-assign a basic_socket_acceptor from another. Move-assign a basic_socket_acceptor from an acceptor of another protocol type. |
|
|
Set an option on the acceptor. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
The maximum length of the queue of pending incoming connections. |
|
|
Specify that the data should not be subject to routing. |
|
|
Specifies that the data marks the end of a record. |
|
|
Process out-of-band data. |
|
|
Peek at incoming data without removing it from the input queue. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The basic_socket_acceptor
class template
is used for accepting new socket connections.
Distinct objects: Safe.
Shared objects: Unsafe.
Opening a socket acceptor with the SO_REUSEADDR option enabled:
boost::asio::ip::tcp::acceptor acceptor(io_service); boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port); acceptor.open(endpoint.protocol()); acceptor.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); acceptor.bind(endpoint); acceptor.listen();
Header: boost/asio/local/stream_protocol.hpp
Convenience header: boost/asio.hpp
The type of a UNIX domain endpoint.
typedef basic_endpoint< stream_protocol > endpoint;
|
Name |
Description |
|---|---|
|
The type of the endpoint structure. This type is dependent on the underlying implementation of the socket layer. |
|
|
The protocol type associated with the endpoint. |
|
Name |
Description |
|---|---|
|
Default constructor. Construct an endpoint using the specified path name.  Set the path associated with the endpoint. |
|
|
The protocol associated with the endpoint. |
|
|
Set the underlying size of the endpoint in the native type. |
|
|
Get the underlying size of the endpoint in the native type. |
|
Name |
Description |
|---|---|
|
Compare two endpoints for inequality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
|
Compare two endpoints for equality. |
|
|
Compare endpoints for ordering. |
|
|
Compare endpoints for ordering. |
|
Name |
Description |
|---|---|
|
Output an endpoint as a string. |
The local::basic_endpoint
class template
describes an endpoint that may be associated with a particular UNIX socket.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/local/stream_protocol.hpp
Convenience header: boost/asio.hpp
The UNIX domain iostream type.
typedef basic_socket_iostream< stream_protocol > iostream;
|
Name |
Description |
|---|---|
|
The duration type. |
|
|
The endpoint type. |
|
|
The time type. |
|
Name |
Description |
|---|---|
|
Construct a basic_socket_iostream without establishing a connection.  Set the stream's expiry time as an absolute time. |
|
|
Get the timer's expiry time relative to now. Set the stream's expiry time relative to now. |
|
|
Return a pointer to the underlying streambuf. |
Header: boost/asio/local/stream_protocol.hpp
Convenience header: boost/asio.hpp
typedef basic_stream_socket< stream_protocol > socket;
|
Name |
Description |
|---|---|
|
Socket option to permit sending of broadcast messages. |
|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
Socket option to enable socket-level debugging. |
|
|
Socket option to prevent routing, use local interfaces only. |
|
|
Socket option to report aborted connections on accept. |
|
|
The endpoint type. |
|
|
The underlying implementation type of I/O object. |
|
|
Socket option to send keep-alives. |
|
|
Socket option to specify whether the socket lingers on close if unsent data is present. |
|
|
A basic_socket is always the lowest layer. |
|
|
Bitmask type for flags that can be passed to send and receive operations. |
|
|
The native representation of a socket. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a socket. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the socket. |
|
|
The protocol type. |
|
|
Socket option for the receive buffer size of a socket. |
|
|
Socket option for the receive low watermark. |
|
|
Socket option to allow the socket to be bound to an address that is already in use. |
|
|
Socket option for the send buffer size of a socket. |
|
|
Socket option for the send low watermark. |
|
|
The type of the service that will be used to provide I/O operations. |
|
|
Different ways a socket may be shutdown. |
|
Name |
Description |
|---|---|
|
Assign an existing native socket to the socket. |
|
|
Start an asynchronous connect. |
|
|
Start an asynchronous read. |
|
|
Start an asynchronous receive. |
|
|
Start an asynchronous send. |
|
|
Start an asynchronous write. |
|
|
Determine whether the socket is at the out-of-band data mark. |
|
|
Determine the number of bytes available for reading. |
|
|
Construct a basic_stream_socket without opening it. Construct and open a basic_stream_socket. Construct a basic_stream_socket, opening it and binding it to the given local endpoint. Construct a basic_stream_socket on an existing native socket. Move-construct a basic_stream_socket from another.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native socket representation. |
|
|
Get the native socket representation. |
|
|
Gets the non-blocking mode of the native socket implementation. Sets the non-blocking mode of the native socket implementation. |
|
|
Gets the non-blocking mode of the socket. Sets the non-blocking mode of the socket. |
|
|
Open the socket using the specified protocol. |
|
|
Move-assign a basic_stream_socket from another. Move-assign a basic_stream_socket from a socket of another protocol type. |
|
|
Read some data from the socket. |
|
|
Receive some data on the socket. Receive some data on a connected socket. |
|
|
Get the remote endpoint of the socket. |
|
|
Send some data on the socket. |
|
|
Set an option on the socket. |
|
|
Disable sends or receives on the socket. |
|
|
Write some data to the socket. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
The maximum length of the queue of pending incoming connections. |
|
|
Specify that the data should not be subject to routing. |
|
|
Specifies that the data marks the end of a record. |
|
|
Process out-of-band data. |
|
|
Peek at incoming data without removing it from the input queue. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The basic_stream_socket
class template
provides asynchronous and blocking stream-oriented socket functionality.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/local/stream_protocol.hpp
Convenience header: boost/asio.hpp
Holds a buffer that can be modified.
class mutable_buffer
|
Name |
Description |
|---|---|
|
Construct an empty buffer. Construct a buffer to represent a given memory range. |
|
Name |
Description |
|---|---|
|
Create a new modifiable buffer that is offset from the start of another. |
The mutable_buffer
class provides a safe representation of a buffer that can be modified. It
does not own the underlying data, and so is cheap to copy or assign.
The contents of a buffer may be accessed using the buffer_size
and buffer_cast
functions:
boost::asio::mutable_buffer b1 = ...; std::size_t s1 = boost::asio::buffer_size(b1); unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
The boost::asio::buffer_cast
function permits violations
of type safety, so uses of it in application code should be carefully considered.
Header: boost/asio/buffer.hpp
Convenience header: boost/asio.hpp
mutable_buffer(); » more...
Construct a buffer to represent a given memory range.
mutable_buffer( void * data, std::size_t size); » more...
Construct a buffer to represent a given memory range.
mutable_buffer( void * data, std::size_t size);
Create a new modifiable buffer that is offset from the start of another.
mutable_buffer operator+( const mutable_buffer & b, std::size_t start); » more... mutable_buffer operator+( std::size_t start, const mutable_buffer & b); » more...
Create a new modifiable buffer that is offset from the start of another.
mutable_buffer operator+( const mutable_buffer & b, std::size_t start);
Create a new modifiable buffer that is offset from the start of another.
mutable_buffer operator+( std::size_t start, const mutable_buffer & b);
Adapts a single modifiable buffer so that it meets the requirements of the MutableBufferSequence concept.
class mutable_buffers_1 : public mutable_buffer
|
Name |
Description |
|---|---|
|
A random-access iterator type that may be used to read elements. |
|
|
The type for each element in the list of buffers. |
|
Name |
Description |
|---|---|
|
Get a random-access iterator to the first element. |
|
|
Get a random-access iterator for one past the last element. |
|
|
Construct to represent a given memory range. Construct to represent a single modifiable buffer. |
|
Name |
Description |
|---|---|
|
Create a new modifiable buffer that is offset from the start of another. |
Header: boost/asio/buffer.hpp
Convenience header: boost/asio.hpp
A random-access iterator type that may be used to read elements.
typedef const mutable_buffer * const_iterator;
Header: boost/asio/buffer.hpp
Convenience header: boost/asio.hpp
Construct to represent a given memory range.
mutable_buffers_1( void * data, std::size_t size); » more...
Construct to represent a single modifiable buffer.
explicit mutable_buffers_1( const mutable_buffer & b); » more...
Construct to represent a given memory range.
mutable_buffers_1( void * data, std::size_t size);
Construct to represent a single modifiable buffer.
mutable_buffers_1( const mutable_buffer & b);
Create a new modifiable buffer that is offset from the start of another.
mutable_buffer operator+( const mutable_buffer & b, std::size_t start); » more... mutable_buffer operator+( std::size_t start, const mutable_buffer & b); » more...
Inherited from mutable_buffer.
Create a new modifiable buffer that is offset from the start of another.
mutable_buffer operator+( const mutable_buffer & b, std::size_t start);
Inherited from mutable_buffer.
Create a new modifiable buffer that is offset from the start of another.
mutable_buffer operator+( std::size_t start, const mutable_buffer & b);
The type for each element in the list of buffers.
typedef mutable_buffer value_type;
|
Name |
Description |
|---|---|
|
Construct an empty buffer. Construct a buffer to represent a given memory range. |
|
Name |
Description |
|---|---|
|
Create a new modifiable buffer that is offset from the start of another. |
The mutable_buffer
class provides a safe representation of a buffer that can be modified.
It does not own the underlying data, and so is cheap to copy or assign.
The contents of a buffer may be accessed using the buffer_size
and buffer_cast
functions:
boost::asio::mutable_buffer b1 = ...; std::size_t s1 = boost::asio::buffer_size(b1); unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
The boost::asio::buffer_cast
function permits violations
of type safety, so uses of it in application code should be carefully considered.
Header: boost/asio/buffer.hpp
Convenience header: boost/asio.hpp
An implementation of both the ConstBufferSequence and MutableBufferSequence concepts to represent a null buffer sequence.
class null_buffers
|
Name |
Description |
|---|---|
|
A random-access iterator type that may be used to read elements. |
|
|
The type for each element in the list of buffers. |
|
Name |
Description |
|---|---|
|
Get a random-access iterator to the first element. |
|
|
Get a random-access iterator for one past the last element. |
Header: boost/asio/buffer.hpp
Convenience header: boost/asio.hpp
A random-access iterator type that may be used to read elements.
typedef const mutable_buffer * const_iterator;
Header: boost/asio/buffer.hpp
Convenience header: boost/asio.hpp
The type for each element in the list of buffers.
typedef mutable_buffer value_type;
|
Name |
Description |
|---|---|
|
Construct an empty buffer. Construct a buffer to represent a given memory range. |
|
Name |
Description |
|---|---|
|
Create a new modifiable buffer that is offset from the start of another. |
The mutable_buffer
class provides a safe representation of a buffer that can be modified.
It does not own the underlying data, and so is cheap to copy or assign.
The contents of a buffer may be accessed using the buffer_size
and buffer_cast
functions:
boost::asio::mutable_buffer b1 = ...; std::size_t s1 = boost::asio::buffer_size(b1); unsigned char* p1 = boost::asio::buffer_cast<unsigned char*>(b1);
The boost::asio::buffer_cast
function permits violations
of type safety, so uses of it in application code should be carefully considered.
Header: boost/asio/buffer.hpp
Convenience header: boost/asio.hpp
An argument placeholder, for use with boost::bind(),
that corresponds to the bytes_transferred argument of a handler for asynchronous
functions such as boost::asio::basic_stream_socket::async_write_some
or boost::asio::async_write
.
unspecified bytes_transferred;
Header: boost/asio/placeholders.hpp
Convenience header: boost/asio.hpp
An argument placeholder, for use with boost::bind(), that corresponds to the error argument of a handler for any of the asynchronous functions.
unspecified error;
Header: boost/asio/placeholders.hpp
Convenience header: boost/asio.hpp
An argument placeholder, for use with boost::bind(), that corresponds to the iterator argument of a handler for asynchronous functions such as boost::asio::basic_resolver::async_resolve.
unspecified iterator;
Header: boost/asio/placeholders.hpp
Convenience header: boost/asio.hpp
An argument placeholder, for use with boost::bind(),
that corresponds to the signal_number argument of a handler for asynchronous
functions such as boost::asio::signal_set::async_wait
.
unspecified signal_number;
Header: boost/asio/placeholders.hpp
Convenience header: boost/asio.hpp
Provides POSIX descriptor functionality.
template< typename DescriptorService> class basic_descriptor : public basic_io_object< DescriptorService >, public posix::descriptor_base
|
Name |
Description |
|---|---|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
The underlying implementation type of I/O object. |
|
|
A basic_descriptor is always the lowest layer. |
|
|
The native representation of a descriptor. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a descriptor. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. |
|
|
The type of the service that will be used to provide I/O operations. |
|
Name |
Description |
|---|---|
|
Assign an existing native descriptor to the descriptor. |
|
|
Construct a basic_descriptor without opening it. Construct a basic_descriptor on an existing native descriptor.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native descriptor representation. |
|
|
Get the native descriptor representation. |
|
|
Gets the non-blocking mode of the native descriptor implementation. Sets the non-blocking mode of the native descriptor implementation. |
|
|
Gets the non-blocking mode of the descriptor. Sets the non-blocking mode of the descriptor. |
|
|
Move-assign a basic_descriptor from another. |
|
|
Release ownership of the native descriptor implementation. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
|
Protected destructor to prevent deletion through this type. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The posix::basic_descriptor
class template
provides the ability to wrap a POSIX descriptor.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
Assign an existing native descriptor to the descriptor.
void assign( const native_handle_type & native_descriptor); » more... boost::system::error_code assign( const native_handle_type & native_descriptor, boost::system::error_code & ec); » more...
Assign an existing native descriptor to the descriptor.
void assign( const native_handle_type & native_descriptor);
Assign an existing native descriptor to the descriptor.
boost::system::error_code assign( const native_handle_type & native_descriptor, boost::system::error_code & ec);
Construct a posix::basic_descriptor
without opening
it.
explicit basic_descriptor( boost::asio::io_service & io_service); » more...
Construct a posix::basic_descriptor
on an existing
native descriptor.
basic_descriptor( boost::asio::io_service & io_service, const native_handle_type & native_descriptor); » more...
Move-construct a posix::basic_descriptor
from another.
basic_descriptor( basic_descriptor && other); » more...
Construct a posix::basic_descriptor
without opening
it.
basic_descriptor( boost::asio::io_service & io_service);
This constructor creates a descriptor without opening it.
The io_service
object that
the descriptor will use to dispatch handlers for any asynchronous
operations performed on the descriptor.
Construct a posix::basic_descriptor
on an existing
native descriptor.
basic_descriptor( boost::asio::io_service & io_service, const native_handle_type & native_descriptor);
This constructor creates a descriptor object to hold an existing native descriptor.
The io_service
object that
the descriptor will use to dispatch handlers for any asynchronous
operations performed on the descriptor.
A native descriptor.
Thrown on failure.
Move-construct a posix::basic_descriptor
from another.
basic_descriptor( basic_descriptor && other);
This constructor moves a descriptor from one object to another.
The other posix::basic_descriptor
object
from which the move will occur.
Following the move, the moved-from object is in the same state as if
constructed using the basic_descriptor(io_service&) constructor
.
Inherited from posix::descriptor_base.
IO control command to get the amount of data that can be read without blocking.
typedef implementation_defined bytes_readable;
Implements the FIONREAD IO control command.
boost::asio::posix::stream_descriptor descriptor(io_service); ... boost::asio::descriptor_base::bytes_readable command(true); descriptor.io_control(command); std::size_t bytes_readable = command.get();
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
Cancel all asynchronous operations associated with the descriptor.
void cancel(); » more... boost::system::error_code cancel( boost::system::error_code & ec); » more...
Cancel all asynchronous operations associated with the descriptor.
void cancel();
This function causes all outstanding asynchronous read or write operations
to finish immediately, and the handlers for cancelled operations will
be passed the boost::asio::error::operation_aborted
error.
Thrown on failure.
Cancel all asynchronous operations associated with the descriptor.
boost::system::error_code cancel( boost::system::error_code & ec);
This function causes all outstanding asynchronous read or write operations
to finish immediately, and the handlers for cancelled operations will
be passed the boost::asio::error::operation_aborted
error.
Set to indicate what error occurred, if any.
void close(); » more... boost::system::error_code close( boost::system::error_code & ec); » more...
Close the descriptor.
void close();
This function is used to close the descriptor. Any asynchronous read
or write operations will be cancelled immediately, and will complete
with the boost::asio::error::operation_aborted
error.
Thrown on failure. Note that, even if the function indicates an error, the underlying descriptor is closed.
Close the descriptor.
boost::system::error_code close( boost::system::error_code & ec);
This function is used to close the descriptor. Any asynchronous read
or write operations will be cancelled immediately, and will complete
with the boost::asio::error::operation_aborted
error.
Set to indicate what error occurred, if any. Note that, even if the function indicates an error, the underlying descriptor is closed.
Get the underlying implementation of the I/O object.
implementation_type & get_implementation(); » more... const implementation_type & get_implementation() const; » more...
Inherited from basic_io_object.
Get the underlying implementation of the I/O object.
implementation_type & get_implementation();
Inherited from basic_io_object.
Get the underlying implementation of the I/O object.
const implementation_type & get_implementation() const;
Inherited from basic_io_object.
Get the io_service
associated with the
object.
boost::asio::io_service & get_io_service();
This function may be used to obtain the io_service
object that the I/O
object uses to dispatch handlers for asynchronous operations.
A reference to the io_service
object that the I/O
object will use to dispatch handlers. Ownership is not transferred to the
caller.
Get the service associated with the I/O object.
service_type & get_service(); » more... const service_type & get_service() const; » more...
Inherited from basic_io_object.
Get the service associated with the I/O object.
service_type & get_service();
Inherited from basic_io_object.
Get the service associated with the I/O object.
const service_type & get_service() const;
Inherited from basic_io_object.
(Deprecated: Use get_implementation()
.) The underlying implementation of the
I/O object.
implementation_type implementation;
Inherited from basic_io_object.
The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
Perform an IO control command on the descriptor.
template< typename IoControlCommand> void io_control( IoControlCommand & command); » more... template< typename IoControlCommand> boost::system::error_code io_control( IoControlCommand & command, boost::system::error_code & ec); » more...
Perform an IO control command on the descriptor.
template< typename IoControlCommand> void io_control( IoControlCommand & command);
This function is used to execute an IO control command on the descriptor.
The IO control command to be performed on the descriptor.
Thrown on failure.
Getting the number of bytes ready to read:
boost::asio::posix::stream_descriptor descriptor(io_service); ... boost::asio::posix::stream_descriptor::bytes_readable command; descriptor.io_control(command); std::size_t bytes_readable = command.get();
Perform an IO control command on the descriptor.
template< typename IoControlCommand> boost::system::error_code io_control( IoControlCommand & command, boost::system::error_code & ec);
This function is used to execute an IO control command on the descriptor.
The IO control command to be performed on the descriptor.
Set to indicate what error occurred, if any.
Getting the number of bytes ready to read:
boost::asio::posix::stream_descriptor descriptor(io_service); ... boost::asio::posix::stream_descriptor::bytes_readable command; boost::system::error_code ec; descriptor.io_control(command, ec); if (ec) { // An error occurred. } std::size_t bytes_readable = command.get();
Get a reference to the lowest layer.
lowest_layer_type & lowest_layer(); » more...
Get a const reference to the lowest layer.
const lowest_layer_type & lowest_layer() const; » more...
Get a reference to the lowest layer.
lowest_layer_type & lowest_layer();
This function returns a reference to the lowest layer in a stack of layers.
Since a posix::basic_descriptor
cannot contain
any further layers, it simply returns a reference to itself.
A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
Get a const reference to the lowest layer.
const lowest_layer_type & lowest_layer() const;
This function returns a const reference to the lowest layer in a stack
of layers. Since a posix::basic_descriptor
cannot contain
any further layers, it simply returns a reference to itself.
A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
A posix::basic_descriptor
is always the
lowest layer.
typedef basic_descriptor< DescriptorService > lowest_layer_type;
|
Name |
Description |
|---|---|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
The underlying implementation type of I/O object. |
|
|
A basic_descriptor is always the lowest layer. |
|
|
The native representation of a descriptor. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a descriptor. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. |
|
|
The type of the service that will be used to provide I/O operations. |
|
Name |
Description |
|---|---|
|
Assign an existing native descriptor to the descriptor. |
|
|
Construct a basic_descriptor without opening it. Construct a basic_descriptor on an existing native descriptor.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native descriptor representation. |
|
|
Get the native descriptor representation. |
|
|
Gets the non-blocking mode of the native descriptor implementation. Sets the non-blocking mode of the native descriptor implementation. |
|
|
Gets the non-blocking mode of the descriptor. Sets the non-blocking mode of the descriptor. |
|
|
Move-assign a basic_descriptor from another. |
|
|
Release ownership of the native descriptor implementation. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
|
Protected destructor to prevent deletion through this type. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The posix::basic_descriptor
class template
provides the ability to wrap a POSIX descriptor.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
(Deprecated: Use native_handle()
.) Get the native descriptor representation.
native_type native();
This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
Get the native descriptor representation.
native_handle_type native_handle();
This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
The native representation of a descriptor.
typedef DescriptorService::native_handle_type native_handle_type;
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
Gets the non-blocking mode of the native descriptor implementation.
bool native_non_blocking() const; » more...
Sets the non-blocking mode of the native descriptor implementation.
void native_non_blocking( bool mode); » more... boost::system::error_code native_non_blocking( bool mode, boost::system::error_code & ec); » more...
Gets the non-blocking mode of the native descriptor implementation.
bool native_non_blocking() const;
This function is used to retrieve the non-blocking mode of the underlying native descriptor. This mode has no effect on the behaviour of the descriptor object's synchronous operations.
true
if the underlying descriptor
is in non-blocking mode and direct system calls may fail with boost::asio::error::would_block
(or the equivalent system
error).
The current non-blocking mode is cached by the descriptor object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native descriptor.
Sets the non-blocking mode of the native descriptor implementation.
void native_non_blocking( bool mode);
This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
If true
, the underlying
descriptor is put into non-blocking mode and direct system calls
may fail with boost::asio::error::would_block
(or the equivalent system error).
Thrown on failure. If the mode
is false
, but the
current value of non_blocking()
is true
,
this function fails with boost::asio::error::invalid_argument
,
as the combination does not make sense.
Sets the non-blocking mode of the native descriptor implementation.
boost::system::error_code native_non_blocking( bool mode, boost::system::error_code & ec);
This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
If true
, the underlying
descriptor is put into non-blocking mode and direct system calls
may fail with boost::asio::error::would_block
(or the equivalent system error).
Set to indicate what error occurred, if any. If the mode
is false
,
but the current value of non_blocking()
is true
,
this function fails with boost::asio::error::invalid_argument
,
as the combination does not make sense.
(Deprecated: Use native_handle_type.) The native representation of a descriptor.
typedef DescriptorService::native_handle_type native_type;
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
Gets the non-blocking mode of the descriptor.
bool non_blocking() const; » more...
Sets the non-blocking mode of the descriptor.
void non_blocking( bool mode); » more... boost::system::error_code non_blocking( bool mode, boost::system::error_code & ec); » more...
Gets the non-blocking mode of the descriptor.
bool non_blocking() const;
true
if the descriptor's
synchronous operations will fail with boost::asio::error::would_block
if they are unable to perform the requested operation immediately. If
false
, synchronous operations
will block until complete.
The non-blocking mode has no effect on the behaviour of asynchronous
operations. Asynchronous operations will never fail with the error boost::asio::error::would_block
.
Sets the non-blocking mode of the descriptor.
void non_blocking( bool mode);
If true
, the descriptor's
synchronous operations will fail with boost::asio::error::would_block
if they are unable to perform the requested operation immediately.
If false
, synchronous
operations will block until complete.
Thrown on failure.
The non-blocking mode has no effect on the behaviour of asynchronous
operations. Asynchronous operations will never fail with the error boost::asio::error::would_block
.
Sets the non-blocking mode of the descriptor.
boost::system::error_code non_blocking( bool mode, boost::system::error_code & ec);
If true
, the descriptor's
synchronous operations will fail with boost::asio::error::would_block
if they are unable to perform the requested operation immediately.
If false
, synchronous
operations will block until complete.
Set to indicate what error occurred, if any.
The non-blocking mode has no effect on the behaviour of asynchronous
operations. Asynchronous operations will never fail with the error boost::asio::error::would_block
.
Inherited from posix::descriptor_base.
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor.
typedef implementation_defined non_blocking_io;
Implements the FIONBIO IO control command.
boost::asio::posix::stream_descriptor descriptor(io_service); ... boost::asio::descriptor_base::non_blocking_io command(true); descriptor.io_control(command);
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
Move-assign a posix::basic_descriptor
from another.
basic_descriptor & operator=( basic_descriptor && other);
This assignment operator moves a descriptor from one object to another.
The other posix::basic_descriptor
object
from which the move will occur.
Following the move, the moved-from object is in the same state as if constructed
using the basic_descriptor(io_service&) constructor
.
Release ownership of the native descriptor implementation.
native_handle_type release();
This function may be used to obtain the underlying representation of the
descriptor. After calling this function, is_open()
returns false. The caller is responsible
for closing the descriptor.
All outstanding asynchronous read or write operations will finish immediately,
and the handlers for cancelled operations will be passed the boost::asio::error::operation_aborted
error.
Inherited from basic_io_object.
(Deprecated: Use get_service()
.) The service associated with the I/O
object.
service_type & service;
Available only for services that do not support movability.
Inherited from basic_io_object.
The type of the service that will be used to provide I/O operations.
typedef DescriptorService service_type;
Header: boost/asio/posix/basic_descriptor.hpp
Convenience header: boost/asio.hpp
Provides stream-oriented descriptor functionality.
template< typename StreamDescriptorService = stream_descriptor_service> class basic_stream_descriptor : public posix::basic_descriptor< StreamDescriptorService >
|
Name |
Description |
|---|---|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
The underlying implementation type of I/O object. |
|
|
A basic_descriptor is always the lowest layer. |
|
|
The native representation of a descriptor. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a descriptor. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. |
|
|
The type of the service that will be used to provide I/O operations. |
|
Name |
Description |
|---|---|
|
Assign an existing native descriptor to the descriptor. |
|
|
Start an asynchronous read. |
|
|
Start an asynchronous write. |
|
|
Construct a basic_stream_descriptor without opening it. Construct a basic_stream_descriptor on an existing native descriptor.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native descriptor representation. |
|
|
Get the native descriptor representation. |
|
|
Gets the non-blocking mode of the native descriptor implementation. Sets the non-blocking mode of the native descriptor implementation. |
|
|
Gets the non-blocking mode of the descriptor. Sets the non-blocking mode of the descriptor. |
|
|
Move-assign a basic_stream_descriptor from another. |
|
|
Read some data from the descriptor. |
|
|
Release ownership of the native descriptor implementation. |
|
|
Write some data to the descriptor. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The posix::basic_stream_descriptor
class template
provides asynchronous and blocking stream-oriented descriptor functionality.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/posix/basic_stream_descriptor.hpp
Convenience header: boost/asio.hpp
Assign an existing native descriptor to the descriptor.
void assign( const native_handle_type & native_descriptor); » more... boost::system::error_code assign( const native_handle_type & native_descriptor, boost::system::error_code & ec); » more...
Inherited from posix::basic_descriptor.
Assign an existing native descriptor to the descriptor.
void assign( const native_handle_type & native_descriptor);
Inherited from posix::basic_descriptor.
Assign an existing native descriptor to the descriptor.
boost::system::error_code assign( const native_handle_type & native_descriptor, boost::system::error_code & ec);
template< typename MutableBufferSequence, typename ReadHandler> void-or-deduced async_read_some( const MutableBufferSequence & buffers, ReadHandler handler);
This function is used to asynchronously read data from the stream descriptor. The function call always returns immediately.
One or more buffers into which the data will be read. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.
The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
void handler( const boost::system::error_code& error, // Result of operation. std::size_t bytes_transferred // Number of bytes read. );
Regardless of whether the asynchronous operation completes immediately
or not, the handler will not be invoked from within this function.
Invocation of the handler will be performed in a manner equivalent
to using boost::asio::io_service::post()
.
The read operation may not read all of the requested number of bytes. Consider
using the async_read
function if you need
to ensure that the requested amount of data is read before the asynchronous
operation completes.
To read into a single data buffer use the buffer
function as follows:
descriptor.async_read_some(boost::asio::buffer(data, size), handler);
See the buffer
documentation for information on reading into multiple buffers in one go,
and how to use it with arrays, boost::array or std::vector.
template< typename ConstBufferSequence, typename WriteHandler> void-or-deduced async_write_some( const ConstBufferSequence & buffers, WriteHandler handler);
This function is used to asynchronously write data to the stream descriptor. The function call always returns immediately.
One or more data buffers to be written to the descriptor. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.
The handler to be called when the write operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
void handler( const boost::system::error_code& error, // Result of operation. std::size_t bytes_transferred // Number of bytes written. );
Regardless of whether the asynchronous operation completes immediately
or not, the handler will not be invoked from within this function.
Invocation of the handler will be performed in a manner equivalent
to using boost::asio::io_service::post()
.
The write operation may not transmit all of the data to the peer. Consider
using the async_write
function if you need
to ensure that all data is written before the asynchronous operation completes.
To write a single data buffer use the buffer
function as follows:
descriptor.async_write_some(boost::asio::buffer(data, size), handler);
See the buffer
documentation for information on writing multiple buffers in one go, and
how to use it with arrays, boost::array or std::vector.
Construct a posix::basic_stream_descriptor
without
opening it.
explicit basic_stream_descriptor( boost::asio::io_service & io_service); » more...
Construct a posix::basic_stream_descriptor
on an
existing native descriptor.
basic_stream_descriptor( boost::asio::io_service & io_service, const native_handle_type & native_descriptor); » more...
Move-construct a posix::basic_stream_descriptor
from another.
basic_stream_descriptor( basic_stream_descriptor && other); » more...
Construct a posix::basic_stream_descriptor
without
opening it.
basic_stream_descriptor( boost::asio::io_service & io_service);
This constructor creates a stream descriptor without opening it. The descriptor needs to be opened and then connected or accepted before data can be sent or received on it.
The io_service
object that
the stream descriptor will use to dispatch handlers for any asynchronous
operations performed on the descriptor.
Construct a posix::basic_stream_descriptor
on an
existing native descriptor.
basic_stream_descriptor( boost::asio::io_service & io_service, const native_handle_type & native_descriptor);
This constructor creates a stream descriptor object to hold an existing native descriptor.
The io_service
object that
the stream descriptor will use to dispatch handlers for any asynchronous
operations performed on the descriptor.
The new underlying descriptor implementation.
Thrown on failure.
Move-construct a posix::basic_stream_descriptor
from
another.
basic_stream_descriptor( basic_stream_descriptor && other);
This constructor moves a stream descriptor from one object to another.
The other posix::basic_stream_descriptor
object from which the move will occur.
Following the move, the moved-from object is in the same state as if
constructed using the basic_stream_descriptor(io_service&) constructor
.
Inherited from posix::descriptor_base.
IO control command to get the amount of data that can be read without blocking.
typedef implementation_defined bytes_readable;
Implements the FIONREAD IO control command.
boost::asio::posix::stream_descriptor descriptor(io_service); ... boost::asio::descriptor_base::bytes_readable command(true); descriptor.io_control(command); std::size_t bytes_readable = command.get();
Header: boost/asio/posix/basic_stream_descriptor.hpp
Convenience header: boost/asio.hpp
Cancel all asynchronous operations associated with the descriptor.
void cancel(); » more... boost::system::error_code cancel( boost::system::error_code & ec); » more...
Inherited from posix::basic_descriptor.
Cancel all asynchronous operations associated with the descriptor.
void cancel();
This function causes all outstanding asynchronous read or write operations
to finish immediately, and the handlers for cancelled operations will
be passed the boost::asio::error::operation_aborted
error.
Thrown on failure.
Inherited from posix::basic_descriptor.
Cancel all asynchronous operations associated with the descriptor.
boost::system::error_code cancel( boost::system::error_code & ec);
This function causes all outstanding asynchronous read or write operations
to finish immediately, and the handlers for cancelled operations will
be passed the boost::asio::error::operation_aborted
error.
Set to indicate what error occurred, if any.
void close(); » more... boost::system::error_code close( boost::system::error_code & ec); » more...
Inherited from posix::basic_descriptor.
Close the descriptor.
void close();
This function is used to close the descriptor. Any asynchronous read
or write operations will be cancelled immediately, and will complete
with the boost::asio::error::operation_aborted
error.
Thrown on failure. Note that, even if the function indicates an error, the underlying descriptor is closed.
Inherited from posix::basic_descriptor.
Close the descriptor.
boost::system::error_code close( boost::system::error_code & ec);
This function is used to close the descriptor. Any asynchronous read
or write operations will be cancelled immediately, and will complete
with the boost::asio::error::operation_aborted
error.
Set to indicate what error occurred, if any. Note that, even if the function indicates an error, the underlying descriptor is closed.
Get the underlying implementation of the I/O object.
implementation_type & get_implementation(); » more... const implementation_type & get_implementation() const; » more...
Inherited from basic_io_object.
Get the underlying implementation of the I/O object.
implementation_type & get_implementation();
Inherited from basic_io_object.
Get the underlying implementation of the I/O object.
const implementation_type & get_implementation() const;
Inherited from basic_io_object.
Get the io_service
associated with the
object.
boost::asio::io_service & get_io_service();
This function may be used to obtain the io_service
object that the I/O
object uses to dispatch handlers for asynchronous operations.
A reference to the io_service
object that the I/O
object will use to dispatch handlers. Ownership is not transferred to the
caller.
Get the service associated with the I/O object.
service_type & get_service(); » more... const service_type & get_service() const; » more...
Inherited from basic_io_object.
Get the service associated with the I/O object.
service_type & get_service();
Inherited from basic_io_object.
Get the service associated with the I/O object.
const service_type & get_service() const;
Inherited from basic_io_object.
(Deprecated: Use get_implementation()
.)
The underlying implementation of the I/O object.
implementation_type implementation;
Inherited from basic_io_object.
The underlying implementation type of I/O object.
typedef service_type::implementation_type implementation_type;
Header: boost/asio/posix/basic_stream_descriptor.hpp
Convenience header: boost/asio.hpp
Perform an IO control command on the descriptor.
void io_control( IoControlCommand & command); » more... boost::system::error_code io_control( IoControlCommand & command, boost::system::error_code & ec); » more...
Inherited from posix::basic_descriptor.
Perform an IO control command on the descriptor.
template< typename IoControlCommand> void io_control( IoControlCommand & command);
This function is used to execute an IO control command on the descriptor.
The IO control command to be performed on the descriptor.
Thrown on failure.
Getting the number of bytes ready to read:
boost::asio::posix::stream_descriptor descriptor(io_service); ... boost::asio::posix::stream_descriptor::bytes_readable command; descriptor.io_control(command); std::size_t bytes_readable = command.get();
Inherited from posix::basic_descriptor.
Perform an IO control command on the descriptor.
template< typename IoControlCommand> boost::system::error_code io_control( IoControlCommand & command, boost::system::error_code & ec);
This function is used to execute an IO control command on the descriptor.
The IO control command to be performed on the descriptor.
Set to indicate what error occurred, if any.
Getting the number of bytes ready to read:
boost::asio::posix::stream_descriptor descriptor(io_service); ... boost::asio::posix::stream_descriptor::bytes_readable command; boost::system::error_code ec; descriptor.io_control(command, ec); if (ec) { // An error occurred. } std::size_t bytes_readable = command.get();
Inherited from posix::basic_descriptor.
Determine whether the descriptor is open.
bool is_open() const;
Get a reference to the lowest layer.
lowest_layer_type & lowest_layer(); » more...
Get a const reference to the lowest layer.
const lowest_layer_type & lowest_layer() const; » more...
Inherited from posix::basic_descriptor.
Get a reference to the lowest layer.
lowest_layer_type & lowest_layer();
This function returns a reference to the lowest layer in a stack of layers.
Since a posix::basic_descriptor
cannot contain
any further layers, it simply returns a reference to itself.
A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
Inherited from posix::basic_descriptor.
Get a const reference to the lowest layer.
const lowest_layer_type & lowest_layer() const;
This function returns a const reference to the lowest layer in a stack
of layers. Since a posix::basic_descriptor
cannot contain
any further layers, it simply returns a reference to itself.
A const reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.
Inherited from posix::basic_descriptor.
A posix::basic_descriptor
is always the
lowest layer.
typedef basic_descriptor< StreamDescriptorService > lowest_layer_type;
|
Name |
Description |
|---|---|
|
IO control command to get the amount of data that can be read without blocking. |
|
|
The underlying implementation type of I/O object. |
|
|
A basic_descriptor is always the lowest layer. |
|
|
The native representation of a descriptor. |
|
|
(Deprecated: Use native_handle_type.) The native representation of a descriptor. |
|
|
(Deprecated: Use non_blocking().) IO control command to set the blocking mode of the descriptor. |
|
|
The type of the service that will be used to provide I/O operations. |
|
Name |
Description |
|---|---|
|
Assign an existing native descriptor to the descriptor. |
|
|
Construct a basic_descriptor without opening it. Construct a basic_descriptor on an existing native descriptor.  Get a const reference to the lowest layer. |
|
|
(Deprecated: Use native_handle().) Get the native descriptor representation. |
|
|
Get the native descriptor representation. |
|
|
Gets the non-blocking mode of the native descriptor implementation. Sets the non-blocking mode of the native descriptor implementation. |
|
|
Gets the non-blocking mode of the descriptor. Sets the non-blocking mode of the descriptor. |
|
|
Move-assign a basic_descriptor from another. |
|
|
Release ownership of the native descriptor implementation. |
|
Name |
Description |
|---|---|
|
Get the underlying implementation of the I/O object. |
|
|
Get the service associated with the I/O object. |
|
|
Protected destructor to prevent deletion through this type. |
|
Name |
Description |
|---|---|
|
(Deprecated: Use get_implementation().) The underlying implementation of the I/O object. |
|
|
(Deprecated: Use get_service().) The service associated with the I/O object. |
The posix::basic_descriptor
class template
provides the ability to wrap a POSIX descriptor.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: boost/asio/posix/basic_stream_descriptor.hpp
Convenience header: boost/asio.hpp
Inherited from posix::basic_descriptor.
(Deprecated: Use native_handle()
.) Get the native descriptor representation.
native_type native();
This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
Inherited from posix::basic_descriptor.
Get the native descriptor representation.
native_handle_type native_handle();
This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.
The native representation of a descriptor.
typedef StreamDescriptorService::native_handle_type native_handle_type;
Header: boost/asio/posix/basic_stream_descriptor.hpp
Convenience header: boost/asio.hpp
Gets the non-blocking mode of the native descriptor implementation.
bool native_non_blocking() const; » more...
Sets the non-blocking mode of the native descriptor implementation.
void native_non_blocking( bool mode); » more... boost::system::error_code native_non_blocking( bool mode, boost::system::error_code & ec); » more...
Inherited from posix::basic_descriptor.
Gets the non-blocking mode of the native descriptor implementation.
bool native_non_blocking() const;
This function is used to retrieve the non-blocking mode of the underlying native descriptor. This mode has no effect on the behaviour of the descriptor object's synchronous operations.
true
if the underlying descriptor
is in non-blocking mode and direct system calls may fail with boost::asio::error::would_block
(or the equivalent system
error).
The current non-blocking mode is cached by the descriptor object. Consequently, the return value may be incorrect if the non-blocking mode was set directly on the native descriptor.
Inherited from posix::basic_descriptor.
Sets the non-blocking mode of the native descriptor implementation.
void native_non_blocking( bool mode);
This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
If true
, the underlying
descriptor is put into non-blocking mode and direct system calls
may fail with boost::asio::error::would_block
(or the equivalent system error).
Thrown on failure. If the mode
is false
, but the
current value of non_blocking()
is true
,
this function fails with boost::asio::error::invalid_argument
,
as the combination does not make sense.
Inherited from posix::basic_descriptor.
Sets the non-blocking mode of the native descriptor implementation.
boost::system::error_code native_non_blocking( bool mode, boost::system::error_code & ec);
This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.
If true
, the underlying
descriptor is put into non-blocking mode and direct system calls
may fail with boost::asio::error::would_block