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

SimpleUDPClient with 'localhost' defaults to ipv6 but OSCUDPServer has no ipv6 support #109

Open
Ragzouken opened this issue Oct 14, 2019 · 1 comment

Comments

@Ragzouken
Copy link
Contributor

Ran into all our OSC failing after updating to 1.7.4 from 1.7.2. Turns out that because of the newly added ipv6 support, our client with address 'localhost' is now only putting out messages on ipv6. Our corresponding server (OSCUDPServer) is hosting on 'localhost' which still defaults to ipv4. In fast when we try to give it an ipv6 address ('::1') it fails because the underlying socketserver uses the socket.AF_INET address family, which doesn't understand ipv6 addresses.

   def server_bind(self):
        """Called by constructor to bind the socket.

        May be overridden.

        """
        if self.allow_reuse_address:
            self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
>       self.socket.bind(self.server_address)
E       socket.gaierror: [Errno 11001] getaddrinfo failed

..\..\..\Anaconda3\envs\narupa-dev\lib\socketserver.py:466: gaierror

I am able to work around this with the following subclass, but it was certainly very confusing that server and client behave in different ways given the same localhost address, and also that the underlying socket errors are so esoteric.

class ThreadingOSCUDPServerV6(ThreadingOSCUDPServer):
    address_family = socket.AF_INET6

As far as I can tell socket.AF_INET6 doesn't understand ipv4 address so I'm not sure if there's any easy way to support both seamlessly.

@Ragzouken
Copy link
Contributor Author

Actually, there seems to be socket.AF_UNSPEC but I haven't yet worked out how to make it work.

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

No branches or pull requests

1 participant