[zeromq-dev] ZeroMQ question

Philippe MESLIN meslin at syspertec.com
Fri May 4 14:39:06 CEST 2012



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

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.



Philippe MESLIN.


Responsable Développement.




                       <mailto:support at syspertec.com> support at syspertec.com 

                       <mailto:meslin 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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120504/654e9b28/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 70 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120504/654e9b28/attachment.gif>

More information about the zeromq-dev mailing list