mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-17 03:03:25 +02:00
Revert "After speaking with Ben Gray and the discussion on the mailing list, this is an attempt to create a sockopt to allow connecting pipes to not immediately be available for traffic. The problem is in a PUSH to many PULL situation, where there is a connect to a PULL which is not there. This connect will immediately create a pipe (unlike bind), and traffic will be load balanced to that pipe. This means if there is a persistently unavailable end point then the traffic will queue until HWM is hit, and older messages will be lost."
This reverts commit fe3fb419fe
.
This commit is contained in:
@@ -111,7 +111,6 @@ zmq::session_base_t::session_base_t (class io_thread_t *io_thread_,
|
||||
io_object_t (io_thread_),
|
||||
connect (connect_),
|
||||
pipe (NULL),
|
||||
outpipe (NULL),
|
||||
incomplete_in (false),
|
||||
pending (false),
|
||||
engine (NULL),
|
||||
@@ -151,13 +150,6 @@ void zmq::session_base_t::attach_pipe (pipe_t *pipe_)
|
||||
pipe->set_event_sink (this);
|
||||
}
|
||||
|
||||
void zmq::session_base_t::onconnect_attach_pipe (pipe_t *pipe_)
|
||||
{
|
||||
zmq_assert (!is_terminating ());
|
||||
zmq_assert (pipe_);
|
||||
outpipe = pipe_;
|
||||
}
|
||||
|
||||
int zmq::session_base_t::read (msg_t *msg_)
|
||||
{
|
||||
// First message to send is identity (if required).
|
||||
@@ -237,12 +229,6 @@ void zmq::session_base_t::clean_pipes ()
|
||||
|
||||
void zmq::session_base_t::terminated (pipe_t *pipe_)
|
||||
{
|
||||
// If we get a term signal from our held outpipe
|
||||
// we can safely ignore it.
|
||||
if (pipe_ == outpipe) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Drop the reference to the deallocated pipe.
|
||||
zmq_assert (pipe == pipe_);
|
||||
pipe = NULL;
|
||||
@@ -324,12 +310,6 @@ void zmq::session_base_t::process_attach (i_engine *engine_)
|
||||
send_bind (socket, pipes [1]);
|
||||
}
|
||||
|
||||
if (outpipe && options.delay_attach_on_connect) {
|
||||
send_bind (socket, outpipe);
|
||||
// Forget the outpipe
|
||||
outpipe = NULL;
|
||||
}
|
||||
|
||||
// Plug in the engine.
|
||||
zmq_assert (!engine);
|
||||
engine = engine_;
|
||||
@@ -378,12 +358,6 @@ void zmq::session_base_t::process_term (int linger_)
|
||||
// Start pipe termination process. Delay the termination till all messages
|
||||
// are processed in case the linger time is non-zero.
|
||||
pipe->terminate (linger_ != 0);
|
||||
|
||||
// If we're storing to a to be connected, we can clear that as well
|
||||
if (outpipe) {
|
||||
outpipe->set_event_sink (this);
|
||||
outpipe->terminate (linger_ != 0);
|
||||
}
|
||||
|
||||
// TODO: Should this go into pipe_t::terminate ?
|
||||
// In case there's no engine and there's only delimiter in the
|
||||
@@ -411,9 +385,6 @@ void zmq::session_base_t::timer_event (int id_)
|
||||
// Ask pipe to terminate even though there may be pending messages in it.
|
||||
zmq_assert (pipe);
|
||||
pipe->terminate (false);
|
||||
|
||||
if (outpipe)
|
||||
outpipe->terminate (false);
|
||||
}
|
||||
|
||||
void zmq::session_base_t::detached ()
|
||||
|
Reference in New Issue
Block a user