[zeromq-dev] bug with INPROC on WINDOWS 7

Viet Hoang (Quant Edge) viet.hoang at quant-edge.com
Sat Apr 21 09:25:29 CEST 2012

I made a lot of change to the clone 6 pattern to suite our system. However
it was very unstable, with memory read/write access error sometimes, and
corrupted messages also sometimes. After debugging, the issue is with INPROC
connection. If sending small messages (254b), it works perfect. However I
have no control of how large messages would be (upper business process
decides), sometimes it is 9000b (list of client orders).


My temporary solution is to break large messages into small ones (max at


Self->pipe is INPROC connection




clone_set_mem (clone_t *self, byte *key, int64_t klength, byte *value,
int64_t vlength, int ttl)


    zmsg_t *msg = zmsg_new ();

    char ttlstr [10];

    char vlstr [40];

    int64_t rc = 0;


    sprintf (ttlstr, "%d", ttl);

    sprintf (vlstr, "%I64d", vlength);


    zmsg_addstr (msg, "SET");

    zmsg_addmem (msg, key, klength);

    zmsg_addstr (msg, ttlstr);

    zmsg_addstr (msg, vlstr);


    while (rc < vlength) {

        char * new_start = value + rc;

        zmsg_addmem (msg, new_start, vlength - rc);

        rc +=254;



    zmsg_send (&msg, self->pipe);



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120421/46966a7e/attachment.htm>

More information about the zeromq-dev mailing list