}
TBinaryProtocol binaryProtocol =
- new TBinaryProtocol();
+ new TBinaryProtocol(transport, transport);
ThriftTest.Client testClient =
- new ThriftTest.Client(transport, binaryProtocol);
+ new ThriftTest.Client(binaryProtocol);
long timeMin = 0;
long timeMax = 0;
}
// Processor
- TBinaryProtocol binaryProtocol =
- new TBinaryProtocol();
TestHandler testHandler =
new TestHandler();
ThriftTest.Processor testProcessor =
- new ThriftTest.Processor(testHandler, binaryProtocol);
+ new ThriftTest.Processor(testHandler);
// Transport
TServerSocket tServerSocket =
// serverEngine = new TSimpleServer(testProcessor, tServerSocket);
// ThreadPool Server
- serverEngine = new TThreadPoolServer(testProcessor, tServerSocket);
+ serverEngine = new TThreadPoolServer(testProcessor, tServerSocket);
// Run it
System.out.println("Starting the server on port " + port + "...");
$host = $argv[1];
}
-$hosts = array('localhost', '8.2.3.5');
+$hosts = array('localhost');
$socket = new TSocket($host, $port);
$socket = new TSocketPool($hosts, $port);
} else {
$bufferedSocket = new TBufferedTransport($socket, 1024, 1024);
$transport = $bufferedSocket;
- $protocol = new TBinaryProtocol();
- $testClient = new ThriftTestClient($transport, $protocol);
+ $protocol = new TBinaryProtocol($transport);
+ $testClient = new ThriftTestClient($protocol);
}
$transport->open();
else:
transport = TTransport.TBufferedTransport(socket)
-protocol = TBinaryProtocol.TBinaryProtocol()
-client = ThriftTest.Client(transport, protocol)
+protocol = TBinaryProtocol.TBinaryProtocol(transport)
+client = ThriftTest.Client(protocol)
# Connect!
transport.open()
x.message = str
raise x
-transport = TSocket.TServerSocket(9090)
-protocol = TBinaryProtocol.TBinaryProtocol()
handler = TestHandler()
-processor = ThriftTest.Processor(handler, protocol)
-factory = TTransport.TBufferedTransportFactory()
-server = TServer.TSimpleServer(processor, transport, factory)
+processor = ThriftTest.Processor(handler)
+transport = TSocket.TServerSocket(9090)
+tfactory = TTransport.TBufferedTransportFactory()
+pfactory = TBinaryProtocol.TBinaryProtocolFactory()
+server = TServer.TThreadedServer(processor, transport, tfactory, pfactory)
server.serve()