[zeromq-dev] ZeroMQ question

Pieter Hintjens ph at imatix.com
Sat May 5 10:29:31 CEST 2012


Philippe,

The VSM is an internal optimization that allocates very small messages
on the stack instead of in memory. You should never use or care about
that in code.

Please read the Guide and try the examples it has.

If you have a test case that does not work as documented in the man
pages, that is an issue.

Thanks
Pieter

On Fri, May 4, 2012 at 2:39 PM, Philippe MESLIN <meslin at syspertec.com> wrote:
>
> Hello,
>
> We are a software company and we are considering as part of a new project
> using 0MQ.
>
> To understand the limits of the system we wish to initially test the
> exchange of large messages between a sender and a receiver but we encounter
> a difficulty as soon as the message size reaches the default value set in
> ZMQ_MAX_VSM_SIZE
>
> If we run the following code:
>
> int zmq_rc;
> zmq_msg_t request, p_req *;
> zmq_msg_t reply, * p_rep;
>
> zmq_init context = void * (1);
>
> / / Socket to talk to server
> void * = zmq_socket requester (context, ZMQ_REQ);
>
> zmq_connect (requester, "tcp :/ / localhost: 5555");
>
> zmq_rc zmq_msg_init_data = (& request, "Hello My Size is EQUAL TO 29 <",
> sizeof ("Hello My Size is EQUAL TO 29 <"), virtual_proc, NULL);
> printf ("\ n zmq_msg_init_data RC:% d", zmq_rc);
> zmq_rc zmq_send = (requester, & request, 0);
> printf ("\ n zmq_send RC:% d", zmq_rc);
> zmq_msg_close (& request);
>
>
> We have noted that the partner who listens receives in vsm_data the value
> correct sent value i.e "Hello My Size is EQUAL TO 29 <", BUT vsm_size = 30,
> not 29.
>
> Q1: Why the difference?
>
> If we replace the message of 29 long by a 30-long (for example: rc =
> zmq_msg_init_data (& request, "> Hello My Size is EQUAL TO 30 <", sizeof (">
> Hello My Size is EQUAL TO 30 <"), virtual_proc, NULL) ;) 30 or more in
> length, in this case the return code of the call for zmq_msg_init_data is 0,
> but the side of the receiver, the received message (vsm_data) is
> inconsistent and the length (vsm_size) is 0.
>
> This leaves zmq_msg_init_data assumed that the function did not (or could
> not do) are working properly.
>
> Q2: Why in this case, zmq_rc = 0, not a value indicating an inability to
> send the message?
>
> Q3: If that works, how to do a printf (in the sender process) of the value
> and size the initial sent message?
>
> Q4: Is it possible to send messages larger than ZMQ_MAX_VSM_SIZE  without
> changing the value of this constant?
>
> Q5: What is the most powerful method to exchange messages large (> 8K
> <1MB) using 0MQ?
>
> Thank you for your help.
>
>
>
> Regards.
>
> Philippe MESLIN.
>
>
>
> Pôle SYNAPSE.
> Responsable Développement.
>
>
>
> ____________________________________________________________________
>
>
>
>                       support at syspertec.com
>
>                       meslin at syspertec.com
> ____________________________________________________________________
>
>
>
>                          SysperTec Communication
>                           196 Bureaux de la Colline
>                          92213 SAINT-CLOUD Cedex
>
>
>
>                        Phone : +33 (1) 46 02 60 42
>                        Fax     : +33 (1) 46 02 59 98
> ____________________________________________________________________
>
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list