-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
Invalid argument exception during socket.accept on AF_INET6 #164
Comments
I found this from the
I did a bit of testing, and found this behavior with respect to the sockets created by
It seems like because:
... that we should remove trio/socket.py#L191 |
Right, there are two issues here: (1) what we should be doing with Am I reading your table correctly as saying that the problem happens when you set up a listen socket with As to the larger question of defaults, there are a few competing considerations: The problem with accepting the system default is that it leads to non-portable programs (in particular in this case: test on linux, everything works fine because in fact everyone leaves But then there's another issue: initially I hoped that |
This is also a problem, but what I was originally trying to describe, completely ignoring with trio.socket.socket(trio.socket.AF_INET6) as socket:
socket.bind((host, port))
socket.listen()
accept_socket = await socket.accept()
assert accept_socket._sock.family == AF_INET6
accept_socket.setsockopt(IPPROTO_IPV6, IPV6_V6ONLY, False) ...that the In the table, I'm just trying to show that it probably doesn't make sense to try to |
minimal-ish testcase and exception: https://gist.github.com/8d647f4c8368bc318e73833474601526
If I remove the
setsockopt
call on line 192, the testcase works as expected.Is this a bug, or am I not creating an IPv6 socket correctly?
The text was updated successfully, but these errors were encountered: