diff --git a/cpp/src/server/ServiceWrapper.cpp b/cpp/src/server/ServiceWrapper.cpp index c0c4293ec38cc152877945755e21cd5e17fe65aa..9bf047dabe98a1a5f6c7714730220385d06864c1 100644 --- a/cpp/src/server/ServiceWrapper.cpp +++ b/cpp/src/server/ServiceWrapper.cpp @@ -135,7 +135,7 @@ void ServiceWrapper::StartService() { s_server.reset(new TSimpleServer(processor, serverTransport, transportFactory, protocolFactory)); s_server->serve(); } else if(mode == "thread_pool") { - ::apache::thrift::stdcxx::shared_ptr threadManager(ThreadManager::newSimpleThreadManager(1)); + ::apache::thrift::stdcxx::shared_ptr threadManager(ThreadManager::newSimpleThreadManager()); ::apache::thrift::stdcxx::shared_ptr threadFactory(new PosixThreadFactory()); threadManager->threadFactory(threadFactory); threadManager->start(); diff --git a/cpp/test_client/src/ClientApp.cpp b/cpp/test_client/src/ClientApp.cpp index 78d5f1c999c33e6d7cce32c1bdeaf6f7c61c245d..fe9f368d83c7c133147e7aaf2b02ff6cb9c4a819 100644 --- a/cpp/test_client/src/ClientApp.cpp +++ b/cpp/test_client/src/ClientApp.cpp @@ -43,7 +43,7 @@ void ClientApp::Run(const std::string &config_file) { std::string mode = server_config.GetValue(server::CONFIG_SERVER_MODE, "thread_pool"); - ::apache::thrift::stdcxx::shared_ptr socket_ptr(new ::apache::thrift::transport::TSocket("localhost", 9090)); + ::apache::thrift::stdcxx::shared_ptr socket_ptr(new ::apache::thrift::transport::TSocket(address, port)); ::apache::thrift::stdcxx::shared_ptr transport_ptr(new TBufferedTransport(socket_ptr)); ::apache::thrift::stdcxx::shared_ptr protocol_ptr; if(protocol == "binary") { @@ -59,17 +59,17 @@ void ClientApp::Run(const std::string &config_file) { VecServiceClient client(protocol_ptr); try { client.dummy(); -// VecGroup group; -// group.id = "test_group"; -// group.dimension = 256; -// group.index_type = 0; -// client.add_group(group); + + VecGroup group; + group.id = "test_group"; + group.dimension = 256; + group.index_type = 0; + client.add_group(group); } catch (apache::thrift::TException& ex) { printf("%s", ex.what()); } transport_ptr->close(); - server::CommonUtil::PrintInfo("test_client exit..."); } }