[zeromq-dev] Poll hangup on inproc socket

Alexey Melnichuk mimir at newmail.ru
Wed Dec 17 10:23:06 CET 2014

Windows XP. LibUV 1.0.0.
ZMQ 3.2.6/4.0.5/4.1.0/4.2.0

I try use zmq socket with libuv poll.
And faced with problem that poll does not work with inproc transport
I create basic example on Lua[1] using my bindings to zmq and libuv.

I create 2 socket(pub/sub) run uv_timer to publish messages and register
sub as uv_poll_socket. It works if endpoint is tcp. But with inproc poll 
callback does not call.
But if I add call `cli:recv(zmq.DONTWAIT)` before I call uv_run it start works
as expected (this call returns EAGAIN)

-- Create socket pair
local srv = ctx:socket{"PUB", bind    = ep}
local cli = ctx:socket{"SUB", connect = ep, subscribe = "" }
-- run publisher
uv.timer():start(1000, 1000, function() srv:send("hello") end)
-- register subscriber
uv.poll_socket(cli:fd()):start(function() --[[do io here]] end)
-- Magic to work with inproc
cli:recv(zmq.DONTWAIT)-- ????????????????????
-- round the world

[1] - https://gist.github.com/moteus/fc8324c12770f266666b

More information about the zeromq-dev mailing list