Some thrift test code improvements
authorMark Slee <mcslee@apache.org>
Wed, 7 Mar 2007 05:17:25 +0000 (05:17 +0000)
committerMark Slee <mcslee@apache.org>
Wed, 7 Mar 2007 05:17:25 +0000 (05:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665050 13f79535-47bb-0310-9956-ffa450edef68

test/rb/TestClient.rb
test/rb/TestServer.rb
test/threads/ThreadsClient.cpp
test/threads/ThreadsServer.cpp

index beb5af1..a4aecb8 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
 
 $:.push('gen-rb')
 $:.push('../../lib/rb/lib')
index 62b73f7..6e08313 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/ruby
+#!/usr/bin/env ruby
 
 $:.push('gen-rb')
 $:.push('../../lib/rb/lib')
index d8f6766..7ad6f00 100644 (file)
@@ -10,6 +10,7 @@
 #include <thrift/concurrency/ThreadManager.h>
 #include <thrift/concurrency/PosixThreadFactory.h>
 
+using boost::shared_ptr;
 using namespace facebook::thrift;
 using namespace facebook::thrift::protocol;
 using namespace facebook::thrift::transport;
index f5bd665..7d17eca 100644 (file)
@@ -4,12 +4,14 @@
 #include "ThreadsTest.h"
 #include <protocol/TBinaryProtocol.h>
 #include <server/TThreadPoolServer.h>
+#include <server/TThreadedServer.h>
 #include <transport/TServerSocket.h>
 #include <transport/TTransportUtils.h>
 #include <thrift/concurrency/Monitor.h>
 #include <thrift/concurrency/ThreadManager.h>
 #include <thrift/concurrency/PosixThreadFactory.h>
 
+using boost::shared_ptr;
 using namespace facebook::thrift;
 using namespace facebook::thrift::protocol;
 using namespace facebook::thrift::transport;
@@ -84,23 +86,31 @@ int main(int argc, char **argv) {
   shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
   shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
 
+  /*
   shared_ptr<ThreadManager> threadManager = 
     ThreadManager::newSimpleThreadManager(10);
   shared_ptr<PosixThreadFactory> threadFactory =
     shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
   threadManager->threadFactory(threadFactory);
   threadManager->start();
-  
-  shared_ptr<TServer> threadPoolServer =
+  shared_ptr<TServer> server =
     shared_ptr<TServer>(new TThreadPoolServer(processor,
                                               serverTransport,
                                               transportFactory,
                                               protocolFactory,
                                               threadManager));
+  */
 
-  handler->setServer(threadPoolServer);
+  shared_ptr<TServer> server =
+    shared_ptr<TServer>(new TThreadedServer(processor,
+                                            serverTransport,
+                                            transportFactory,
+                                            protocolFactory));
 
-  threadPoolServer->serve();
+  handler->setServer(server);
+
+  server->serve();
 
   fprintf(stderr, "done.\n");