On platforms that don't support IPV6_V6ONLY, just ignore it and hope the platform doesn't automatically enable IPv6 mapped IPv4 addresses

This allows the lobby server to be used on platforms that don't support IPV6_V6ONLY socket option.

Thanks to Buginator for reporting this.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7342 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2009-05-06 19:29:56 +00:00 committed by Git SVN Gateway
parent 3042114be5
commit a71b83b91b
1 changed files with 7 additions and 1 deletions

View File

@ -261,7 +261,13 @@ class TCP6Server(SocketServer.TCPServer):
Overridden to enable IPV6_V6ONLY.
"""
try:
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
except AttributeError:
# Apparently IPV6_V6ONLY isn't supported on this
# platform. Lets hope that IPv6 mapping of IPv4
# addresses isn't supported either...
pass
SocketServer.TCPServer.server_bind(self)
class ThreadingTCP6Server(SocketServer.ThreadingMixIn, TCP6Server): pass