Reputation: 31
What is the difference between TBufferedTransport
and TFramedTransport
? How to make choice?
Upvotes: 3
Views: 1449
Reputation: 13411
TBufferedTransport
implements simply an internal buffer that is put in between the sender/receiver part and the "raw" transports. The idea is to improve performance, but you should test if it really does in your particular use case.
In contrast, TFramedTransport
adds a 4 byte header in front of the data carrying the number of message bytes to follow. This allows for certain optimizations on the receiving end. Furthermore, some server types implicitly require the client to use TFramedTransport
.
Long story short
TFramedTransport
is usually a good choice, but both ends have to support it, because it changes the message data that go over the wire.TFramedTransport
already buffers data internally.Upvotes: 3