mirror of
https://github.com/boostorg/redis.git
synced 2026-02-21 15:22:14 +00:00
27 lines
719 B
C++
27 lines
719 B
C++
/* Copyright (c) 2019 - 2021 Marcelo Zimbres Silva (mzimbres at gmail dot com)
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#include <iostream>
|
|
|
|
#include <aedis/aedis.hpp>
|
|
|
|
#include "types.hpp"
|
|
|
|
aedis::net::awaitable<tcp_socket>
|
|
make_connection(
|
|
std::string host,
|
|
std::string port)
|
|
{
|
|
auto ex = co_await aedis::net::this_coro::executor;
|
|
tcp_resolver resolver{ex};
|
|
auto const res = co_await resolver.async_resolve(host, port);
|
|
tcp_socket socket{ex};
|
|
co_await aedis::net::async_connect(socket, res);
|
|
co_return std::move(socket);
|
|
}
|
|
|