anyio: IPv6 is not supported

Currently it’s impossible to create TCP or UDP server listening on IPv6 address, also it’s impossible to connect to IPv6 address using anyio.connect_tcp() because socket.gaierror: [Errno -9] Address family for hostname not supported is raised.

To solve the issue I suggest to make following changes:

  • allow to pass optional family argument to create_tcp_server() and create_udp_socket()
  • if family is not given infer it from interface argument if possible
  • implement create_connection() function and use it instead of socket.connect() in connect_tcp() function

If proposed changes are fine with you I will submit a pull request.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (16 by maintainers)

Most upvoted comments

Almost done. Just need to check the new TCP connection logic.