Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect localhost #56

Open
iassasin opened this issue Mar 7, 2018 · 2 comments
Open

Can't connect localhost #56

iassasin opened this issue Mar 7, 2018 · 2 comments
Labels

Comments

@iassasin
Copy link

iassasin commented Mar 7, 2018

Hello, I'd tried to use connection to localhost with this code:

boost::asio::io_service io;
boost::asio::ip::tcp::resolver resolver(io);
boost::asio::ip::tcp::resolver::query query("localhost", "6379");
auto ep = resolver.resolve(query)->endpoint();
redisclient::RedisSyncClient redisInstance;
redisInstance.connect(ep);

but it fails with exception "Invalid argument". I made a research and found out the problem: boost 1.62 resolves localhost as ipv6 endpoint "::1", but redisclient supports only ipv4 (redissyncclient.cpp:65):

addr.sin_family = AF_INET;
addr.sin_port = htons(endpoint.port());
addr.sin_addr.s_addr = inet_addr(endpoint.address().to_string().c_str());

Hope it helps :)

P.S.: Latest version, commit f55ffdc

@iassasin
Copy link
Author

iassasin commented Mar 7, 2018

А, черт, можно было не ломать английский и писать на русском 😄

@nekipelov
Copy link
Owner

Привет. Да, с ipv6 у меня не доработано. Постараюсь исправить в ближайшее время.

@nekipelov nekipelov added the todo label Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants