IPv6 question

Erno Kuusela erno-news at erno.iki.fi
Tue Feb 17 21:08:12 CET 2004

"John Burton" <john.burton at jbmail.com> writes:

> Thanks for this it seems to work well.
> It does seem that on windows you need to bind different sockets to the same
> address,
> one for IPv4 and one for IPv6 whereas on linux the IPv6 socket will receive
> connections to both.
> I suppose that's not a big problem but a shame.

you can control this using the IPV6_V6ONLY socket option, like so:

  s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)

unfortunately python 2.3.3 doesn't yet make that constant available
though it is fixed in cvs. you could glean the value from the headers.

the default setting has been in flux on various platforms recently,
all the more reason to want to always set it explicitly...

  -- erno

More information about the Python-list mailing list