Fix for IPv6 Python sockets binding localhost problem
authorMark Slee <mcslee@apache.org>
Fri, 27 Jul 2007 18:56:56 +0000 (18:56 +0000)
committerMark Slee <mcslee@apache.org>
Fri, 27 Jul 2007 18:56:56 +0000 (18:56 +0000)
Reviewed By: mcslee

Test Plan: Python Thrift server

Notes: From ps@powerset.com

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665179 13f79535-47bb-0310-9956-ffa450edef68

lib/py/src/transport/TSocket.py

index e8b43be..ec48a6e 100644 (file)
@@ -32,7 +32,7 @@ class TSocket(TTransportBase):
 
   def open(self):
     try:
-      res0 = socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM)
+      res0 = socket.getaddrinfo(self.host, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, socket.AI_PASSIVE)
       for res in res0:
         self.handle = socket.socket(res[0], res[1])
         try: