簡體   English   中英

節儉並發:未解決的外部

[英]Thrift Concurrency: Unresolved externals

我打算將我們的節儉型簡單服務器升級為非阻塞服務器。 為此,我必須鏈接thriftnb lib。 鏈接nb lib修復了與非阻塞服務器有關的未解決的外部錯誤; 但是,我仍然無法獲得線程工廠的外部組件,例如posix或boost線程工廠。 我認為節儉並發也存在於nb庫(或普通節儉庫)中。 據我所知,只有兩個節儉庫,那么我還缺少什么呢?

謝謝!

節儉0.11 C ++ 11

我仍然不確定為什么缺少boost和posix線程工廠,但是StdThreadFactory正在運行。 對於任何有興趣的人,這是我的配置:

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);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM