From 0c2dff3f5a69726e98636c091454b9b5e3ab8898 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Fri, 9 Mar 2007 19:26:57 +0000 Subject: [PATCH] Fix broken C++ Thrift test git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665057 13f79535-47bb-0310-9956-ffa450edef68 --- test/cpp/src/TestServer.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp index bd6a2cff..c8ecf15c 100644 --- a/test/cpp/src/TestServer.cpp +++ b/test/cpp/src/TestServer.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -13,8 +14,10 @@ #include using namespace std; +using namespace boost; using namespace facebook::thrift; +using namespace facebook::thrift::concurrency; using namespace facebook::thrift::protocol; using namespace facebook::thrift::transport; using namespace facebook::thrift::server; @@ -264,7 +267,7 @@ int main(int argc, char **argv) { usage << argv[0] << " [--port=] [--server-type=] [--protocol-type=] [--workers=]" << endl << - "\t\tserver-type\t\ttype of server, \"simple\", \"thread-pool\", or \"nonblocking\". Default is " << serverType << endl << + "\t\tserver-type\t\ttype of server, \"simple\", \"thread-pool\", \"threaded\", or \"nonblocking\". Default is " << serverType << endl << "\t\tprotocol-type\t\ttype of protocol, \"binary\", \"ascii\", or \"xml\". Default is " << protocolType << endl << @@ -300,6 +303,7 @@ int main(int argc, char **argv) { serverType = args["server-type"]; if (serverType == "simple") { } else if (serverType == "thread-pool") { + } else if (serverType == "threaded") { } else if (serverType == "nonblocking") { } else { throw invalid_argument("Unknown server type "+serverType); @@ -371,6 +375,16 @@ int main(int argc, char **argv) { printf("Starting the server on port %d...\n", port); threadPoolServer.serve(); + } else if (serverType == "threaded") { + + TThreadedServer threadedServer(testProcessor, + serverSocket, + transportFactory, + protocolFactory); + + printf("Starting the server on port %d...\n", port); + threadedServer.serve(); + } else if (serverType == "nonblocking") { TNonblockingServer nonblockingServer(testProcessor, port); -- 2.17.1