TNonblockingServer in thrift crashes when TFramedTransport opens

前端 未结 1 1591
无人及你
无人及你 2021-01-19 16:07

I\'ve been trying to implement a thrift server in C++ to communicate with a Python client.

here is my code:

C++ server:

shared_ptr

        
相关标签:
1条回答
  • 2021-01-19 16:12

    Sorry, have not seen earlier, but looks like the same issue: Service Multiplexing using Apache Thrift

    In short, you have to use either framed on both sides, or none.

    shared_ptr<TTransportFactory> _transportFactory(new TFramedTransportFactory());
    shared_ptr<TNonblockingServer> _server(
       new TNonblockingServer(
         _processor, 
         _transportFactory,
         _transportFactory,
         _protocolFactory, 
         _protocolFactory, 
         9090,
         _threadManager));
    _server->serve();
    
    0 讨论(0)
提交回复
热议问题