boostorg / redis

An async redis client designed for performance and scalability
https://www.boost.org/doc/libs/develop/libs/redis/doc/html/index.html
Boost Software License 1.0
212 stars 38 forks source link

resolve addresses The specified class was not found #200

Closed liuaifu closed 1 month ago

liuaifu commented 1 month ago

I'm using Boost1.85 + Redis7.0. I made a few changes to a example, and when the async_exec function is executed, it will output some error messages, which seem related to resolving domains. However, my connected IP address is 127.0.0.1, port 6379, which is the default value. I am very puzzled by this error message, please help me troubleshoot the problem. Thank you.

auto conn = std::make_shared<connection>(co_await asio::this_coro::executor);
conn->async_run(cfg, { boost::redis::logger::level::debug }, asio::consign(asio::detached, conn));

request req;
req.push("SET", "name", "zhangsan");
req.push("GET", "name");

generic_response resp;

co_await conn->async_exec(req, resp, asio::deferred);
conn->cancel();
(Boost.Redis) run-all-op: resolve addresses The specified class was not found.
......
The I/O operation has been aborted because of either a thread exit or an application request.
criatura2 commented 1 month ago

Can you show us how are you constructing cfg.

liuaifu commented 1 month ago
std::string g_redis_ip = "127.0.0.1";
uint16_t g_redis_port = 6379;
// ----------------------------------------
config cfg;
cfg.addr.host = g_redis_ip;
cfg.addr.port = std::to_string(g_redis_port);

@criatura2

mzimbres commented 1 month ago

Did you manage to solve the problem? I don't see anything wrong with your code. Can you connect to this address using redis-cli? Sorry for being late to this conversation, I have had some busy days.

liuaifu commented 1 month ago

This problem occurs on some computers, I did not solve it, using redis-cli can connect to the address, I changed to hiredis. Expect boost.redis to become more stable and I'll come back and use it