mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 12:18:04 +01:00
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.
This commit is contained in:
11
src/req.cpp
11
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;
|
||||
|
||||
Reference in New Issue
Block a user