mirror of https://github.com/milvus-io/milvus.git
client sucessfully connect to server
Former-commit-id: f2bdb21901c8f11b434421c5c33148b177fbf082pull/191/head
parent
162bd5af3d
commit
5b791bf4b0
|
@ -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...");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue