我用c ++编写了一个thrift服务器。当服务器运行时,我收到一个错误:
Thrift:Fri Mar 24 11:21:31 2017 TServerSocket :: acceptImpl()THRIFT_POLL()系统调用中断 Thrift:Fri Mar 24 11:21:31 2017 TServerTransport去世:未知:系统调用中断
但这个错误不会永远发生。从错误提示,THRIFT_POLL()函数中的thrift得到一个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;
}