ruby-protobuf / protobuf

A pure ruby implementation of Google's Protocol Buffers
https://github.com/ruby-protobuf
MIT License
463 stars 101 forks source link

none of these callback(on_complete, on_success and on_failure) were called #340

Closed tzwm closed 8 years ago

tzwm commented 8 years ago

I don't know why it happened. I use the gem protobuf-rpc-register. There are callbacks in this method. And I found no callback be called even I added on_complete.

mmmries commented 8 years ago

@tzwm I think you opened this on the wrong repository. I think you intended you file an issue with scorix/protobuf-rpc-register since that is the gem you are using. This repository is for the protobuf gem

tzwm commented 8 years ago

@mmmries I'm using scorix/protobuf-rpc-register, but this gem is using callback by protobuf. I found the problem is no callback was called. And the callback is belongs to protobuf.

liveh2o commented 8 years ago

What happens when you call send_rpc_request without a block? If the client is configured correctly, you should get a raw Protobuf response back.

I ask because we are using this code in production today without issue. I also maintain ActiveRemote which uses the callbacks in it's Protobuf adapter, which is are also using in production without issue.

tzwm commented 8 years ago

Finally I found the problem is about the socket. We got the size of data by this method, and read data by size. But I can't pass the validation about size. The real size of data is smaller than data size which got from TCPSocket#getc before. So protobuf will not run the next code if two size is not equal.