summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-30 10:08:35 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-30 10:08:35 +0200
commitf2ff2c6e5c4e244dea28e1ac6ec3f886b7ebc356 (patch)
tree33ff7bf025d8bbb3afc8d4cb83f5613ebb956300 /src/pipe.cpp
parent84d854a088d27b642355d4e835a2d93e405452ae (diff)
checking for available messages added to ypipe/pipe
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index f8dfcb8..e444520 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -36,6 +36,17 @@ zmq::reader_t::~reader_t ()
{
}
+bool zmq::reader_t::check_read ()
+{
+ // Check if there's an item in the pipe.
+ if (pipe->check_read ())
+ return true;
+
+ // If not, deactivate the pipe.
+ endpoint->kill (this);
+ return false;
+}
+
bool zmq::reader_t::read (zmq_msg_t *msg_)
{
if (!pipe->read (msg_)) {