From 61ee6fae536a8000be87b5aaf271f6519a3b7d3f Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Mon, 1 Mar 2010 10:13:26 +0100 Subject: 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. --- src/object.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/object.cpp') diff --git a/src/object.cpp b/src/object.cpp index 356fcd1..5821c89 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -95,6 +95,10 @@ void zmq::object_t::process_command (command_t &cmd_) process_seqnum (); break; + case command_t::reader_info: + process_reader_info (cmd_.args.reader_info.msgs_read); + break; + case command_t::pipe_term: process_pipe_term (); return; @@ -249,6 +253,16 @@ void zmq::object_t::send_revive (object_t *destination_) send_command (cmd); } +void zmq::object_t::send_reader_info (writer_t *destination_, + uint64_t msgs_read_) +{ + command_t cmd; + cmd.destination = destination_; + cmd.type = command_t::reader_info; + cmd.args.reader_info.msgs_read = msgs_read_; + send_command (cmd); +} + void zmq::object_t::send_pipe_term (writer_t *destination_) { command_t cmd; @@ -323,6 +337,11 @@ void zmq::object_t::process_revive () zmq_assert (false); } +void zmq::object_t::process_reader_info (uint64_t msgs_read_) +{ + zmq_assert (false); +} + void zmq::object_t::process_pipe_term () { zmq_assert (false); -- cgit v1.2.3