title: Can zmq::message_t's be reused after being sent?
body: <p>I'm using ZeroMQ to implement a toy communications protocol; and this is my first time using this framework/library.</p>
  
  <p>Now, in my protocol, multiple consecutive messages get sent by a certain party, all of which have the same size. So - I thought, I'd avoid reallocating them, and just try to refill the message data buffer with different content, e.g.:</p>
  
  <pre><code>zmq::message_t msg { fixed_common_size };
  while (some_condition()) {
      my_filling_routine(msg.data(), fixed_common_size);
      the_socket.send(msg);
  }
  </code></pre>
  
  <p>but on the second iteration of this loop, I get a segmentation fault; <code>msg.data()</code> is not <code>nullptr</code> though. It occurred to me, that maybe ZeroMQ cannibalizes the memory somehow, and thus I need to write something like:</p>
  
  <pre><code>zmq::message_t msg { fixed_common_size };
  char buffer[fixed_common_size];
  while (some_condition()) {
      my_filling_routine(buffer, fixed_common_size);
      msg.rebuild(buffer, fixed_common_size);
      the_socket.send(msg);
  }
  </code></pre>
  
  <p>But I'm sure this causes de-allocation and re-allocation. </p>
  
  <p>So, is it really the case that a <code>rebuild()</code> is necessary, or could it just be some bug in my code?</p>
  
  <p>Note: I'm using Unix sockets, in case the answer depends on that somehow.</p>