andygrundman / thrift-xs

Perl XS/C version of Thrift MemoryBuffer and BinaryProtocol
7 stars 3 forks source link

Thrift::XS::BinaryProtocol only works with Thrift::XS::MemoryBuffer as transport #1

Open cftarnas opened 13 years ago

cftarnas commented 13 years ago

First - thanks for writing an Thrift::XS package - Perl can really use it.

I am trying it out and found this. Any calls to the write* methods of Thrift::XS::BinaryProtocol do not correctly call the underlying transport write() method, it dies with the message:

Can't call method "write" on an undefined value
andygrundman commented 13 years ago

Thanks, hmm, I thought this worked. Really you don't want to use any other transport anyway because of how inefficient it is (lots of 1-byte read/write calls). I'll see about adding a test for this though.

cftarnas commented 13 years ago

I'm using a Thrift::XS::MemoryBuffer inside my own Transport class, but as I am also not using this in an event loop I have no way of checking if the buffer is full and flushing it to the socket unless I wrap around it and check at write time. We also call flush and that gets passed through directly to the underlying transport and as MemoryBuffer doesn't support flush it dies as well.

Thanks for the quick response!

-chris

On Aug 2, 2011, at 2:18 PM, andygrundman wrote:

Thanks, hmm, I thought this worked. Really you don't want to use any other transport anyway because of how inefficient it is (lots of 1-byte read/write calls). I'll see about adding a test for this though.

Reply to this email directly or view it on GitHub: https://github.com/andygrundman/thrift-xs/issues/1#issuecomment-1713277