Describes an endpoint for a version-independent IP socket. More...
#include <basic_endpoint.hpp>
Public Types | |
| typedef InternetProtocol | protocol_type |
| The protocol type associated with the endpoint. More... | |
| typedef boost::asio::detail::socket_addr_type | data_type |
| The type of the endpoint structure. More... | |
Public Member Functions | |
| basic_endpoint () | |
| Default constructor. More... | |
| basic_endpoint (const InternetProtocol &internet_protocol, unsigned short port_num) | |
| Construct an endpoint using a port number, specified in the host's byte order. More... | |
| basic_endpoint (const boost::asio::ip::address &addr, unsigned short port_num) | |
| Construct an endpoint using a port number and an IP address. More... | |
| basic_endpoint (const basic_endpoint &other) | |
| Copy constructor. More... | |
| basic_endpoint & | operator= (const basic_endpoint &other) |
| Assign from another endpoint. More... | |
| protocol_type | protocol () const |
| The protocol associated with the endpoint. More... | |
| data_type * | data () |
| Get the underlying endpoint in the native type. More... | |
| const data_type * | data () const |
| Get the underlying endpoint in the native type. More... | |
| std::size_t | size () const |
| Get the underlying size of the endpoint in the native type. More... | |
| void | resize (std::size_t new_size) |
| Set the underlying size of the endpoint in the native type. More... | |
| std::size_t | capacity () const |
| Get the capacity of the endpoint in the native type. More... | |
| unsigned short | port () const |
| Get the port associated with the endpoint. More... | |
| void | port (unsigned short port_num) |
| Set the port associated with the endpoint. More... | |
| boost::asio::ip::address | address () const |
| Get the IP address associated with the endpoint. More... | |
| void | address (const boost::asio::ip::address &addr) |
| Set the IP address associated with the endpoint. More... | |
Friends | |
| bool | operator== (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2) |
| Compare two endpoints for equality. More... | |
| bool | operator!= (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2) |
| Compare two endpoints for inequality. More... | |
| bool | operator< (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2) |
| Compare endpoints for ordering. More... | |
| bool | operator> (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2) |
| Compare endpoints for ordering. More... | |
| bool | operator<= (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2) |
| Compare endpoints for ordering. More... | |
| bool | operator>= (const basic_endpoint< InternetProtocol > &e1, const basic_endpoint< InternetProtocol > &e2) |
| Compare endpoints for ordering. More... | |
Related Functions | |
(Note that these are not member functions.) | |
| template<typename Elem , typename Traits , typename InternetProtocol > | |
| std::basic_ostream< Elem, Traits > & | operator<< (std::basic_ostream< Elem, Traits > &os, const basic_endpoint< InternetProtocol > &endpoint) |
| Output an endpoint as a string. More... | |
Describes an endpoint for a version-independent IP socket.
The boost::asio::ip::basic_endpoint class template describes an endpoint that may be associated with a particular socket.
| typedef boost::asio::detail::socket_addr_type boost::asio::ip::basic_endpoint< InternetProtocol >::data_type |
The type of the endpoint structure.
This type is dependent on the underlying implementation of the socket layer.
| typedef InternetProtocol boost::asio::ip::basic_endpoint< InternetProtocol >::protocol_type |
The protocol type associated with the endpoint.
|
inline |
Default constructor.
|
inline |
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.
To specify an IPv6 UDP endpoint for port 9876, use:
|
inline |
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.
|
inline |
Copy constructor.
|
inline |
Get the IP address associated with the endpoint.
|
inline |
Set the IP address associated with the endpoint.
|
inline |
Get the capacity of the endpoint in the native type.
|
inline |
Get the underlying endpoint in the native type.
|
inline |
Get the underlying endpoint in the native type.
|
inline |
Assign from another endpoint.
|
inline |
Get the port associated with the endpoint.
The port number is always in the host's byte order.
|
inline |
Set the port associated with the endpoint.
The port number is always in the host's byte order.
|
inline |
The protocol associated with the endpoint.
References boost::sinks::v4, and boost::sinks::v6.
|
inline |
Set the underlying size of the endpoint in the native type.
|
inline |
Get the underlying size of the endpoint in the native type.
|
friend |
Compare two endpoints for inequality.
|
friend |
Compare endpoints for ordering.
|
related |
Output an endpoint as a string.
Used to output a human-readable string for a specified endpoint.
| os | The output stream to which the string will be written. |
| endpoint | The endpoint to be written. |
|
friend |
Compare endpoints for ordering.
|
friend |
Compare two endpoints for equality.
|
friend |
Compare endpoints for ordering.
|
friend |
Compare endpoints for ordering.