diff --git a/src/ZMQ.jl b/src/ZMQ.jl index ee14d9f..2e81a87 100644 --- a/src/ZMQ.jl +++ b/src/ZMQ.jl @@ -450,7 +450,10 @@ function send(socket::Socket, zmsg::Message, SNDMORE::Bool=false) wait(socket) end else - get_events(socket) != 0 && notify(socket) + notify_is_expensive = !isempty(socket.pollfd.notify.waitq) + if notify_is_expensive + get_events(socket) != 0 && notify(socket) + end break end end @@ -482,7 +485,10 @@ function recv(socket::Socket) wait(socket) end else - get_events(socket) != 0 && notify(socket) + notify_is_expensive = !isempty(socket.pollfd.notify.waitq) + if notify_is_expensive + get_events(socket) != 0 && notify(socket) + end break end end