diff options
author | Martin Hurton <hurtonm@gmail.com> | 2010-03-01 10:13:26 +0100 |
---|---|---|
committer | Martin Hurton <hurtonm@gmail.com> | 2010-03-12 11:07:38 +0100 |
commit | 61ee6fae536a8000be87b5aaf271f6519a3b7d3f (patch) | |
tree | 4c088ad3c62ff35a5e5482d9127dc510e5b3aaf7 /src/req.cpp | |
parent | 31d36104aa7caead6f299f0c5cb58a9fde7cf9b0 (diff) |
Implement flow control
This commit introduces the necessary changes necessary
for implementing flow control. None of the socket types
implements the flow control yet. The code will crash when
the flow control is enabled and the thw lwm is reached.
The following commits will add flow-control support for
individual socket types.
Diffstat (limited to 'src/req.cpp')
-rw-r--r-- | src/req.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/req.cpp b/src/req.cpp index 5c067b3..f21613a 100644 --- a/src/req.cpp +++ b/src/req.cpp @@ -108,6 +108,11 @@ void zmq::req_t::xrevive (class reader_t *pipe_) reply_pipe_active = true; } +void zmq::req_t::xrevive (class writer_t *pipe_) +{ + zmq_not_implemented (); +} + int zmq::req_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { @@ -142,11 +147,9 @@ int zmq::req_t::xsend (zmq_msg_t *msg_, int flags_) current = 0; } - // TODO: Implement this once queue limits are in-place. - zmq_assert (out_pipes [current]->check_write (zmq_msg_size (msg_))); - // Push message to the selected pipe. - out_pipes [current]->write (msg_); + bool written = out_pipes [current]->write (msg_); + zmq_assert (written); out_pipes [current]->flush (); waiting_for_reply = true; |