10#include <boost/asio/connect.hpp>
13#include <aedis/src.hpp>
15namespace net = boost::asio;
16namespace resp3 = aedis::resp3;
26 tcp::resolver resv{ioc};
27 auto const res = resv.resolve(
"127.0.0.1",
"6379");
28 tcp::socket socket{ioc};
29 net::connect(socket, res);
34 req.
push(
"PING",
"Hello world");
39 std::string buffer, resp;
42 auto dbuffer = net::dynamic_buffer(buffer);
47 std::cout <<
"Ping: " << resp << std::endl;
49 }
catch (std::exception
const& e) {
50 std::cerr << e.what() << std::endl;
void push(boost::string_view cmd, Ts const &... args)
Appends a new command to the end of the request.
auto adapt2() noexcept
Creates a dummy response adapter.
auto write(SyncWriteStream &stream, Request const &req)
Writes a request synchronously.
auto read(SyncReadStream &stream, DynamicBuffer buf, ResponseAdapter adapter, boost::system::error_code &ec) -> std::size_t
Reads a complete response to a command sychronously.