3 ms·
About the same time, I used zeromq in a project for similar reasons: - I wanted easy message framing - I didn't know much about networks - HTTP servers that ca
by ReactiveJelly 6y ago
About the same time, I used zeromq in a project for similar reasons:
- I wanted easy message framing
- I didn't know much about networks
- HTTP servers that can be embedded in C++ aren't great, and I didn't know anything about HTTP
- It is nice that you can ignore application startup order if you don't care much about reliability, which I didn't
If I knew then what I know now, I would probably have picked something else. For one, I couldn't make it integrate with my main event loop, so I had it block in another thread, and that caused a problem of inter-thread communication that was nearly as bad as the original problem, for me as an inexperienced noobie.
- froskur 6y ago> I couldn't make it integrate with my main event loop You can get a file descriptor from ZMQ to use with your own event loop (depending on your event loop of course). I have done this successfully in the past with an epoll (iirc) based event loop. The documentation is at [1], the ZMQ_FD option. You do have to read the instructions very carefully though. [1] http://api.zeromq.org/master:zmq-getsockopt http://api.zeromq.org/master:zmq-getsockopt