[zeromq-dev] ZMQ in ocaml rep socket does not recv all

Kenneth Adam Miller kennethadammiller at gmail.com
Mon Nov 24 23:58:10 CET 2014


In ocaml I am using ZMQ and piqi to serialize data structures to strings
and ZMQ to send them around. I'm having a problem where I'm using a tcp REQ
socket to request work (initially) and a TCP reply socket to send the
results back. In my unit tests, I can see that the test subvect (worker)
correctly receives a work request, correctly computes a result, and then
sends that back to a psuedo (work broker). Basically it goes like this, 1 &
2 are concurrent:

1) worker sends "" over req to signify that it is ready to receive
requests. This first request string is empty, but from here on out,
subsequent requests contain the result of work computation

subsequently, the worker receives some reply from the psuedo broker; some
call that maps to a function that is deserialized via piqi parse calls.
(This part is what I was saying is correct in my test) It correctly
computes what is desired.

worker's sending of computed result back out over req string is the result
of computation and signifies to broker that it is ready for more.

2) psuedo broker recvs the empty string, and routes a piqi serialized RPC
request to the worker.

psuedo broker should simply receive the computation result. *Instead it
receives an empty string;* I've checked in the worker code, and it's *not
sending an empty string.

Why?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141124/830663e0/attachment.htm>


More information about the zeromq-dev mailing list