Hacker News new | past | comments | ask | show | jobs | submit login

This is not guaranteed to work. There is internal buffering and readabilty/writability is unrelated to the readability/writability of the underlying fd. You have to get ZMQ_EVENTS, check that readability/writability does not exist, and then make an IO watcher on the underlying fd.

IIRC, you can't do this in pre-2.1.0 ZMQ; hence, using your own event loop is experimental.

(I suppose it is also possible to see if you get EWOULDBLOCK during an IO operation, and then create the IO watcher, regular-socket-style.)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: