Skip to content

Added support for servers with IPv6 addresses. #74

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simontuckwell
Copy link

The current code doesn't support Blynk servers using IPv6 addresses as the socket defaults to IPv4 (family AF_INET) and the address tuple returned by getaddrinfo() has extra values for an IPv6 host.

These changes use the family, type and proto returned by getaddrinfo() and remove the extra values in the address tuple before opening the socket.

The new code also filters the type and proto in the call to getaddrinfo() so that fewer tuples are returned. It still uses only the first element in the list.

Tested on Fedora Linux and Python 3.11.3.

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.

1 participant