Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext
connection::async_ping (2 of 2 overloads)

Checks whether the server is alive.

Synopsis
template<
    class CompletionToken>
auto
async_ping(
    diagnostics& diag,
    CompletionToken&& token);
Description

If the server is alive, this function will complete without error. If it's not, it will fail with the relevant network or protocol error.

Note that ping requests are treated as any other type of request at the protocol level, and won't be prioritized anyhow by the server. If the server is stuck in a long-running query, the ping request won't be answered until the query is finished.

Handler signature

The handler signature for this operation is void(boost::mysql::error_code).

Executor

Intermediate completion handlers, as well as the final handler, are executed using token's associated executor, or this->get_executor() if the token doesn't have an associated executor.

If the final handler has an associated immediate executor, and the operation completes immediately, the final handler is dispatched to it. Otherwise, the final handler is called as if it was submitted using asio::post, and is never be called inline from within this function.


PrevUpHomeNext