You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by 82317697 <82...@qq.com> on 2014/11/12 04:25:09 UTC

A doubt about thrift(c++)

I have looked at the code of the  thrift(c++) ,then i have a doubt about the 
"class TNonblockingServer::TConnection::Task",‍‍‍‍
TNonblockingServer‍ received a complete package will create a task to work thread processing,‍
I think the work thread just need process once for the package,so I doubt about the code:


      for (;;) {
        if (serverEventHandler_) {
          serverEventHandler_->processContext(connectionContext_, connection_->getTSocket());
        }
        if (!processor_->process(input_, output_, connectionContext_) ||
            !input_->getTransport()->peek()) {
          break;
        }
      }‍



why use the "for(;;)", just need run once, Could you help me solve this doubt it for me? ‍
Thank you very much!