zeromq / cppzmq

Header-only C++ binding for libzmq
http://www.zeromq.org
MIT License
1.93k stars 757 forks source link

poller_t and file descriptors (and why draft api) #557

Closed jhsaren closed 1 year ago

jhsaren commented 2 years ago

Would it be possible to add the normal file descriptor into poller_t? It is possible in the c api of zmq so this functionality seems to be missing in cppzmq.

I'm using cppzmq in a multithreaded program which merges measurement data from ADC cards. I have been mostly happy to cppzmq because of RAII. Now, I need to include slow control data into the program via UDP protocol. The sender is not in my hands and is not using zmq so I'm just using posix socket. I also would benefit to have the same poller been able to poll incoming zmq traffic and polling the normal file simultaneously. In meanwhile I have to use the c api for poller.

A side note. Is there any clear reason why the simple zmq::poller_t requires DRAFT api? This makes the installing of my software much more difficult since the installing of DRAFT support is not easy always.

gummif commented 1 year ago

Sorry for the late reply, but poller is still in DRAFT in libzmq so is has to be this way until that is fixed upstream. Adding functions to poller taking ::zmq::fd_t instead of socket_ref would be relatively easy (I hadn't noticed that these were missing until now).