2017-03-24 1 views
0

나는 C++로 쓰레드 서버를 작성한다.thrift TServerSocket :: acceptImpl() THRIFT_POLL() 중단 된 시스템 호출

드리프트 : 금 3월 24일 11시 21분 31초 2017 TServerSocket :: acceptImpl() THRIFT_POLL() 중단 시스템 호출 드리프트 : 금 3월 24일 11시 21분 31초 2017 서버가 실행 중일 때, 나는 오류 TServerTransport 사망 : 알 수 없음 : 중단 된 시스템 호출

이 오류는 항상 발생하지 않습니다. 오류 팁에서 THRIFT_POLL() 함수의 절약은 EINTER 신호를 얻습니다. 어떻게이 문제를 해결할 수 있습니까?

는 코드의 main()


int main(int argc, char **argv) { 
// thread pool 
shared_ptr<ServHandler> handler(new ServHandler()); 
shared_ptr<TProcessor> processor(new ServProcessor(handler)); 
shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); 
shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory()); 
shared_ptr<TServerTransport> serverTransport(new TServerSocket(9090)); 

shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(5); 
shared_ptr<PosixThreadFactory> threadFactory = shared_ptr<PosixThreadFactory>(new PosixThreadFactory()); 

threadManager->threadFactory(threadFactory); 
threadManager->start(); 
printf("start...\n"); 

TThreadPoolServer server(processor, 
     serverTransport, 
     transportFactory, 
     protocolFactory, 
     threadManager); 

server.serve(); 

printf("end\n"); 
return 0; 

}

답변

관련 문제