Asio Extensions
Additional functionality built on top of (Boost.)Asio
|
Functions | |
void | asioext::connect (asio::ip::tcp::socket::lowest_layer_type &socket, asio::ip::tcp::resolver &resolver, const asio::ip::tcp::resolver::query &q) |
Establishes a socket connection by trying each endpoint of a resolved name. More... | |
void | asioext::connect (asio::ip::tcp::socket::lowest_layer_type &socket, asio::ip::tcp::resolver &resolver, const asio::ip::tcp::resolver::query &q, error_code &ec) |
Establishes a socket connection by trying each endpoint of a name. More... | |
template<typename ComposedConnectHandler > | |
void_or_deduced | asioext::async_connect (asio::ip::tcp::socket::lowest_layer_type &socket, asio::ip::tcp::resolver &resolver, const asio::ip::tcp::resolver::query &q, ComposedConnectHandler &&handler) |
Asynchronously establishe a socket connection by trying each endpoint of a resolved name. More... | |
void_or_deduced asioext::async_connect | ( | asio::ip::tcp::socket::lowest_layer_type & | socket, |
asio::ip::tcp::resolver & | resolver, | ||
const asio::ip::tcp::resolver::query & | q, | ||
ComposedConnectHandler && | handler | ||
) |
Asynchronously establishe a socket connection by trying each endpoint of a resolved name.
This function attempts to connect a socket by first resolving the given name (using the query and resolver arguments) and then trying each resolved endpoint (by calling the socket's connect member) until a connection is established (or we've run out of endpoints).
socket | The socket to be connected. If the socket is already open, it will be closed. |
resolver | The resolver to be used for our query. |
q | The name to be resolved to a list of endpoints. |
handler | The handler to be called when the connect operation completes. The function signature of the handler must be: void handler( // Result of operation. if the sequence is empty, set to // asio::error::not_found. Otherwise, contains the // error from the last connection attempt. // On success, an iterator denoting the successfully // connected endpoint. Otherwise, the end iterator. asio::ip::tcp::resolver::iterator iterator ); |
void asioext::connect | ( | asio::ip::tcp::socket::lowest_layer_type & | socket, |
asio::ip::tcp::resolver & | resolver, | ||
const asio::ip::tcp::resolver::query & | q | ||
) |
Establishes a socket connection by trying each endpoint of a resolved name.
This function attempts to connect a socket by first resolving the given name (using the query and resolver arguments) and then trying each resolved endpoint (by calling the socket's connect member) until a connection is established (or we've run out of endpoints).
socket | The socket to be connected. If the socket is already open, it will be closed. |
resolver | The resolver to be used for our query. |
q | The name to be resolved to a list of endpoints. |
asio::system_error | Thrown on failure. If the sequence is empty, the associated error_code is asio::error::not_found . Otherwise, contains the error from the last connection attempt. |
void asioext::connect | ( | asio::ip::tcp::socket::lowest_layer_type & | socket, |
asio::ip::tcp::resolver & | resolver, | ||
const asio::ip::tcp::resolver::query & | q, | ||
error_code & | ec | ||
) |
Establishes a socket connection by trying each endpoint of a name.
This function attempts to connect a socket by first resolving the given name (using the query and resolver arguments) and then trying each resolved endpoint (by calling the socket's connect member) until a connection is established (or we've run out of endpoints).
socket | The socket to be connected. If the socket is already open, it will be closed. |
resolver | The resolver to be used for our query. |
q | The name to be resolved to a list of endpoints. |
ec | Set to indicate what error occurred, if any. If the sequence is empty, set to asio::error::not_found . Otherwise, contains the error from the last connection attempt. |