THRIFT-1049. py: Allow for TServerSocket python library to bind to a specific host
authorBryan Duxbury <bryanduxbury@apache.org>
Wed, 26 Jan 2011 17:54:02 +0000 (17:54 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Wed, 26 Jan 2011 17:54:02 +0000 (17:54 +0000)
This patch adds a new host argument to TServerSocket that allows it to bind to a specific host.

Patch: Jake Farrell

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

lib/py/src/transport/TSocket.py

index d77e358..085a5ee 100644 (file)
@@ -126,8 +126,8 @@ class TSocket(TSocketBase):
 class TServerSocket(TSocketBase, TServerTransportBase):
   """Socket implementation of TServerTransport base."""
 
-  def __init__(self, port=9090, unix_socket=None):
-    self.host = None
+  def __init__(self, host=None, port=9090, unix_socket=None):
+    self.host = host
     self.port = port
     self._unix_socket = unix_socket
     self.handle = None