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

Use getaddrinfo to get ipv6 working #313

Merged
merged 2 commits into from Mar 28, 2013
Merged

Use getaddrinfo to get ipv6 working #313

merged 2 commits into from Mar 28, 2013

Conversation

alex88
Copy link
Contributor

@alex88 alex88 commented Mar 25, 2013

I've improved #309 solution by using getaddrinfo.
In this way I get the first result got by getaddrinfo and use the resulting data to select if to use ipv6 or ipv4 as network protocol based on the input address.
I've removed socket.has_ipv6 since it could return true also without ipv6 connection nor ipv6 dns resolving.

I've improved #309 solution by using getaddrinfo.
In this way I get the first result got by getaddrinfo and use the resulting data to select if to use ipv6 or ipv4 as network protocol based on the input address.
I've removed socket.has_ipv6 since it could return true also without ipv6 connection nor ipv6 dns resolving.
@alex88
Copy link
Contributor Author

alex88 commented Mar 25, 2013

A next step would be to loop trough all the returned address found by getaddrinfo and try to connect to each one

I've wrapped the line as your advice, thanks
gmr pushed a commit that referenced this pull request Mar 28, 2013
Use getaddrinfo to get ipv6 working
@gmr gmr merged commit 87e0948 into pika:master Mar 28, 2013
@alex88
Copy link
Contributor Author

alex88 commented Mar 28, 2013

Thanks!

@gmr
Copy link
Member

gmr commented Apr 2, 2013

No problem, I had to update the code a bit, with your patch you would only try and connect on the first IP address resolved and if RabbitMQ was not listening on IPv6 but the hostname resolved to both an IPv4 and IPv6 address (like localhost on my machine) it would fail.

I appreciate the patch, it sent me in the right direction!

@alex88
Copy link
Contributor Author

alex88 commented Apr 2, 2013

Just seen the code, seems perfect now ;) Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants