Thrift TTransportFactory model for servers
Summary: Servers need to create bufferedtransports etc. around the transports they get in a user-definable way. So use a factory pattern to allow the user to supply an object to the server that defines this behavior.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664792 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/py/TestServer.py b/test/py/TestServer.py
index 525ffee..db2ad81 100755
--- a/test/py/TestServer.py
+++ b/test/py/TestServer.py
@@ -5,6 +5,7 @@
import ThriftTest
from ThriftTest_types import *
+from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer
@@ -54,5 +55,6 @@
protocol = TBinaryProtocol.TBinaryProtocol()
handler = TestHandler()
iface = ThriftTest.Server(handler, protocol)
-server = TServer.TSimpleServer(iface, transport)
+factory = TTransport.TBufferedTransportFactory()
+server = TServer.TSimpleServer(iface, transport, factory)
server.run()