提交 8b689e8e 编写于 作者: G groot 提交者: xj.lin

client sucessfully connect to server


Former-commit-id: 1e9186c606ae9ca46f9b2f57ccaeeb50b4cc6c3a
上级 1b9aeb89
......@@ -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(ThreadManager::newSimpleThreadManager(1));
::apache::thrift::stdcxx::shared_ptr<ThreadManager> threadManager(ThreadManager::newSimpleThreadManager());
::apache::thrift::stdcxx::shared_ptr<PosixThreadFactory> threadFactory(new PosixThreadFactory());
threadManager->threadFactory(threadFactory);
threadManager->start();
......
......@@ -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<TSocket> socket_ptr(new ::apache::thrift::transport::TSocket("localhost", 9090));
::apache::thrift::stdcxx::shared_ptr<TSocket> socket_ptr(new ::apache::thrift::transport::TSocket(address, port));
::apache::thrift::stdcxx::shared_ptr<TTransport> transport_ptr(new TBufferedTransport(socket_ptr));
::apache::thrift::stdcxx::shared_ptr<TProtocol> 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...");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册