You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Alexandre Iglesias <ai...@cityway.fr> on 2015/08/17 15:50:51 UTC
C++ TNonblockingserver graceful exit
Hello, thrift mailing list!
When using a TNonBlockingServer in the following way (console application in C++) in the main thread, can I implement something that would shut it down when pressing escape ?
boost::shared_ptr<ThriftGoatServiceHandler> handler(new ThriftGoatServiceHandler());
boost::shared_ptr<TProcessor> processor(new GoatThriftServiceProcessor(handler));
boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
TNonblockingServer server(processor, protocolFactory, port);
try
{
server.serve();
}