[zeromq-dev] ZeroMQ not working well with google protobuf?

Peter Sanders petersanders65 at hotmail.com
Fri Mar 22 13:21:58 CET 2013


Hi Pieter.

Thanks for your reply. Good to hear that lots of people are using it together. My question remains unsolved however.

I've never heard of deallocating memory (I'm using python). Would you be able to give me a hint on whats wrong? I'm totally in the dark here.. Below is the relevant information:


Errors I'm getting: http://pastebin.com/jX4SFapt
earth.py: http://pastebin.com/tvvSZeNR
heaven.py: http://pastebin.com/rtzCsuvg
compiled protobuf message encoder in python: http://www.hkramer.nl/opslag/infoPack_pb2.py


-------------------------------------------------------------------------------


Peter,

Plenty of people use PB and ZMQ together so it's a problem in your
code. Possibly you're getting something wrong with the ZMQ message
lifecycle, i.e. deallocating memory that's not yet been sent, or such.

-Pieter

From: petersanders65 at hotmail.com
To: zeromq-dev at lists.zeromq.org
Subject: RE: ZeroMQ not working well with google protobuf?
Date: Fri, 22 Mar 2013 12:46:08 +0100




Wait, the links didn't come out well:

link to errors: http://pastebin.com/jX4SFapt
earth.py: http://pastebin.com/tvvSZeNR
heaven.py: http://pastebin.com/rtzCsuvg
compiled protobuf message encoder in python: http://www.hkramer.nl/opslag/infoPack_pb2.py

I hope that works..

From: petersanders65 at hotmail.com
To: zeromq-dev at lists.zeromq.org
Subject: ZeroMQ not working well with google protobuf?
Date: Fri, 22 Mar 2013 12:36:35 +0100




Hello People,

I've made a handshake system with two parts: heaven and earth. Earth starts by sending a heartbeat. Heaven receives and replies back with the same heartbeat. If no beat has been received in 2 seconds from either end, both ends take alternative actions while earth continues to send the heartbeat (hoping that heaven will come back). The problem is now, that it worked perfectly fine when I just sent a regular string ('beat'). But once I encoded it using google protocol buffers, earth started giving humongous errors (link to errors). That might indicate that protobuf is making the trouble. But when I set up a simple earth receiver which only receives messages from heaven and not doing anything else (no IOLoop, PeriodicCallback or ZMQStream), it also works perfectly fine.

Would this mean that the combination of ZeroMQ and Protobuf is not a good one? Or am I simply making a mistake which I can't get my head around? If anyone could help me out with this I would be very grateful!

The code I have is as follows:
earth: http://pastebin.com/tvvSZeNRheaven: http://pastebin.com/rtzCsuvg
Messages are encoded using the following google protobuf serialization (link to compiled python encoder):



message heartBeat {
    optional int32 heartBeat = 1;
}



 		 	   		   		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130322/08ac0bf3/attachment.htm>


More information about the zeromq-dev mailing list