In C, we have Sockets and descriptors, you can just take one of them and pass them to Thread, this allows you to accept incoming connections and give Thread work that you like, and Thread can send the answer itself.
My question is: how can I achieve this with ZeroMQ? With the Request-Reply template, it seems that I cannot send and receive asynchronously, the responses should be consistent, my goal would be to have multiple clients on the same server, sending the replies out of sequence.
I looked at the Request Response template, but the API clearly states that using this Socket with multiple Threads is a bad idea. Maybe I missed something, or ZeroMQ is smarter than I know. If you need more information, just send a comment and I will do my best to provide the information.
I also looked at the examples below: Code examples
Here is the description of the Socket: ZMQ-Socket
source share