简体   繁体   中英

Thrift Concurrency: Unresolved externals

I'm attemtping to upgrade our thrift simple server to a nonblocking server. In order to do so, I had to link the thriftnb lib. Linking the nb lib fixed unresolved external errors related to the nonblocking server; however, I am still getting unresolved externals for the thread factories... eg... posix or boost thread factory. I would assume thrift concurrency also lives in the nb lib (or the general thrift lib). As far as I can tell, there are only two thrift libs, so what am I missing?

Thanks!

thrift 0.11 C++ 11

I'm still not sure why the boost and posix thread factories are missing, but the StdThreadFactory is working. For anyone that is interested, this is my config:

std::shared_ptr<apache::thrift::protocol::TProtocolFactory> protocolFactory(new apache::thrift::protocol::TBinaryProtocolFactory());
        std::shared_ptr<apache::thrift::transport::TProcessor> processor(new cimnetservicerefactor::CIMNetServiceRefactorProcessor(stdHandler));
        std::shared_ptr<apache::thrift::TProcessorFactory> processorFactory(new apache::thrift::TSingletonProcessorFactory(processor));
        std::shared_ptr<apache::thrift::transport::TNonblockingServerTransport> serverTransport(new LocalhostOnlyServerSocket(port, machineName, localConnectionsOnly));
        shared_ptr<apache::thrift::concurrency::StdThreadFactory> threadFactory = shared_ptr<apache::thrift::concurrency::StdThreadFactory>(new apache::thrift::concurrency::StdThreadFactory());
        threadManager->threadFactory(threadFactory);
        threadManager->start();
        apache::thrift::server::TNonblockingServer server(processorFactory, protocolFactory, serverTransport, threadManager);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM