OK, so I've retested it with all versions from 2.0.7 to current
master.  The behavior has not changed and the user guide was correct.

- after sending a message its size is set to zero
- 0MQ changes the message data to its own buffer if it does not already own it

However if there was an error sending the message, e.g. if it was not
properly addressed or not properly multipart (e.g. for an XREP) then
the message is not modified.  In 2.0.7 0MQ asserts when given bad
messages; later versions say nothing.  This is why my test last night
on 2.0.9 appeared to show the message unchanged after sending.  Hint:
don't use XREP for this kind of test...

There is no different in behavior depending on message size, socket
type, transport, etc.  It's consistent.

Conclusion:

- sending the same message twice is NOT valid
- zmq_msg_copy does NOT create a resendable copy

-Pieter

On Thu, Sep 23, 2010 at 11:07 AM, Olivier
<[email protected]> wrote:
> If i remember well :
>
> After sending a message, the size is set to 0 in any case so we can't
> re-send it (or it will be empty).
>
> But for the buffer it depends if the size of the message is > ZMQ_VSM
> (=32).
> if yes => free
> if no => no free.
>
> Olivier.
>
>
>
> Le jeudi 23 septembre 2010 à 11:00 +0200, Pieter Hintjens a écrit :
>> 2010/9/23 Ilja Golshtein <[email protected]>:
>>
>> > I am not able to recheck at the mopment,
>> > though I am 99% sure nullifying really takes place in 2.0.7
>>
>> Just retested 2.0.7 and yes, it does nullify the message.
>>
>> I'll test 2.0.7 through to current master and see what the heck is
>> going on here...
>>
>> -
>> Pieter Hintjens
>> iMatix - www.imatix.com
>> _______________________________________________
>> zeromq-dev mailing list
>> [email protected]
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



-- 
-
Pieter Hintjens
iMatix - www.imatix.com
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to