[zeromq-dev] ZeroMQ REQ/REP on ipc:// and concurrency

Matteo Fortini matteo.fortini at gmail.com
Thu Jun 7 07:35:15 CEST 2012


[ I asked this question on stackoverflow, too, if you prefer:
http://stackoverflow.com/q/10918276/107969?sem=2 ]

I implemented a JSON-RPC server using a REQ/REP 0MQ ipc:// socket and I'm
experiencing strange behavior which I suspect is due to the fact that the
ipc:// underlying unix socket is not a real socket, but rather a single
pipe.

>From the documentation, one has to enforce strict zmq_send()/zmq_recv()
alternation, otherwise the out-of-order zmq_send() will return an error.

However, I expected the enforcement to be per-client, not per-socket. Of
course with a Unix socket there is just one pipeline from multiple clients
to the server, so the server won't know who it is talking with. Two clients
could zmq_send() simultaneously and the server would see this as an
alternation violation.

What about tcp:// sockets? Will it work concurrently? Should I use some
other locking mechanism to work around this?

Thank you,
Matteo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120607/55c15788/attachment.htm>


More information about the zeromq-dev mailing list