Explorar el Código

support IPv6 message handler bind IPs

Helge Jung hace 9 años
padre
commit
1f12acc54e
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      modules/ffpb.py

+ 5 - 0
modules/ffpb.py

@@ -84,6 +84,11 @@ class ThreadingTCPServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
     """Defines a threaded TCP socket server."""
     bot = None
 
+    def __init__(self, endpoint, handler):
+        if ':' in endpoint[0]:
+            self.address_family = socket.AF_INET6
+        SocketServer.TCPServer.__init__(self, endpoint, handler)
+
 
 def setup(bot):
     """Called by willie upon loading this plugin."""