On the server side, everything is ok.
But on the client side, it seems we cannot just use Thrift to process the protocol, and send/receive the data by using our own I/O framework(such as muduo or other ones).
Is there any way to implement this with C++?
I think this is a legitimate question, and it can be extended to the more general question:
How do I use other transport mechanisms with Apache Thrift?
As Hcorg pointed out, because of ist modular structure of the framework, it is not quite hard to achieve that. Basically, one has to follow these steps (this is true for all languages supported by Thrift, not only C++)
TServerTransport
derivativeThe existing implementations may serve as models, and despite the number of methods in TTransport
, most of them are not really hard to implement.
Additionally, I also provided a specialized transport implementation to use STOMP with Delphi, based on a TStreamTransport
. The relevant code can be found in the /contrib
Folder and is worth a look. You know, one of the nice things about Thrift is that stuff work very similar in all languages.