summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hurton <hurtonm@gmail.com>2010-03-02 12:41:33 +0100
committerMartin Hurton <hurtonm@gmail.com>2010-03-12 11:07:39 +0100
commit42e575cb6b62fe1e5d12d2e4fb5c6874d47eb57e (patch)
tree65663f9826f40e845d3254ac7f6631125f37ac98
parente34184acc327ae4b085a1a50ff6502e2dc148522 (diff)
Implement flow control fox ZMQ_XREP sockets
-rw-r--r--src/xrep.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xrep.cpp b/src/xrep.cpp
index fae376b..48546d9 100644
--- a/src/xrep.cpp
+++ b/src/xrep.cpp
@@ -83,7 +83,6 @@ void zmq::xrep_t::xrevive (class reader_t *pipe_)
void zmq::xrep_t::xrevive (class writer_t *pipe_)
{
- zmq_not_implemented ();
}
int zmq::xrep_t::xsetsockopt (int option_, const void *optval_,
@@ -116,8 +115,11 @@ int zmq::xrep_t::xsend (zmq_msg_t *msg_, int flags_)
}
// Push message to the selected pipe.
- bool written = it->second->write (msg_);
- zmq_assert (written);
+ if (!it->second->write (msg_)) {
+ errno = EAGAIN;
+ return -1;
+ }
+
it->second->flush ();
// Detach the message from the data buffer.