[zeromq-dev] Message corruption

Conrad Steenberg conrad.steenberg at gmail.com
Wed Aug 26 03:18:48 CEST 2009


Hi Martin et al,

In my application I'm sending a message using
void somefunction(){
  string data=....;
  zmq::message_t out_message ((void *)data.c_str(), data.length(),
NULL);
  while (!api->send (used_exid, out_message, true));
}

Sometimes the data in the message (over TCP) that ends up on the wire is
different than what is put in the message. Up to and including
zmq::pipe_t::write (raw_message_t *msg_) in pipe.cpp, everything seems
OK.

Is there anything obvious in the above snippet that might lead to memory
being trampled upon? Like the "data" string being deallocated when the
function returns? My assumption here is that the message gets "sent"
before the function returns.

What is a reasonable place to check the raw_messages that comes out of
the y_pipe once written?


Thanks!
Conrad




More information about the zeromq-dev mailing list