From cc631c4c6649b0d67114db13386a949426e35dbf Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 1 Oct 2009 10:56:17 +0200 Subject: ZMQII-18: Implement I/O multiplexing (first approximation) --- src/rep.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/rep.cpp') diff --git a/src/rep.cpp b/src/rep.cpp index 137c735..e8a9e39 100644 --- a/src/rep.cpp +++ b/src/rep.cpp @@ -195,4 +195,21 @@ int zmq::rep_t::xrecv (zmq_msg_t *msg_, int flags_) return -1; } +bool zmq::rep_t::xhas_in () +{ + for (int count = active; count != 0; count--) { + if (in_pipes [current]->check_read ()) + return !waiting_for_reply; + current++; + if (current >= active) + current = 0; + } + + return false; +} + +bool zmq::rep_t::xhas_out () +{ + return waiting_for_reply; +} -- cgit v1.2.3