asio C++ library

PrevUpHomeNext

const_pointer

Construct a basic_stream_socket object to represent a given endpoint.

const_pointer(
    const endpoint_type & e);
Examples

Access the endpoint associated with the object.

asio::ip::tcp::socket socket(my_context);
...
// Construct a socket endpoint for IPv4.
asio::ip::tcp::endpoint endpoint(
    asio::ip::v4(), port);
asio::ip::tcp::const_pointer ptr = endpoint.data();
socket.open(ptr); // Valid. Constructs a socket object and
                  // connects it to the given endpoint.

PrevUpHomeNext