summaryrefslogtreecommitdiff
path: root/test/threads
diff options
context:
space:
mode:
authorMark Slee <mcslee@apache.org>2007-03-07 05:17:25 +0000
committerMark Slee <mcslee@apache.org>2007-03-07 05:17:25 +0000
commit02d1edc6f041b968a0f02d01c767f37eda3fab27 (patch)
tree0efc18b3708a13545561e17413fc5f6f604e77a2 /test/threads
parent1d4ce80af87143025b7d830e39d0f86475b980a6 (diff)
downloadthrift-02d1edc6f041b968a0f02d01c767f37eda3fab27.tar.gz
Some thrift test code improvements
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665050 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/threads')
-rw-r--r--test/threads/ThreadsClient.cpp1
-rw-r--r--test/threads/ThreadsServer.cpp18
2 files changed, 15 insertions, 4 deletions
diff --git a/test/threads/ThreadsClient.cpp b/test/threads/ThreadsClient.cpp
index d8f67669c..7ad6f00bb 100644
--- a/test/threads/ThreadsClient.cpp
+++ b/test/threads/ThreadsClient.cpp
@@ -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;
diff --git a/test/threads/ThreadsServer.cpp b/test/threads/ThreadsServer.cpp
index f5bd665c6..7d17ecab9 100644
--- a/test/threads/ThreadsServer.cpp
+++ b/test/threads/ThreadsServer.cpp
@@ -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");