-- Allow specification of socket timeouts in thrift python socket code
Reviewed By: slee
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664976 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/py/src/transport/TSocket.py b/lib/py/src/transport/TSocket.py
index 42ef578..f12f539 100644
--- a/lib/py/src/transport/TSocket.py
+++ b/lib/py/src/transport/TSocket.py
@@ -7,14 +7,18 @@
def __init__(self, host='localhost', port=9090):
self.host = host
- self.port = port
+ self.por t= port
self.handle = None
def setHandle(self, h):
self.handle = h
def isOpen(self):
- return handle != None
+ return self.handle != None
+
+ def setTimeout(self, ms):
+ if (self.handle != None):
+ self.handle.settimeout(ms/1000.00)
def open(self):
self.handle = socket.socket(socket.AF_INET, socket.SOCK_STREAM)