Problem: process_term and close duplicated across subclasses of stream_connecter_base_t

Solution: pull up
This commit is contained in:
Simon Giesecke
2019-01-31 09:39:35 -05:00
parent 531df586d0
commit a09099a615
8 changed files with 39 additions and 98 deletions

View File

@@ -62,23 +62,6 @@ zmq::ipc_connecter_t::ipc_connecter_t (class io_thread_t *io_thread_,
zmq_assert (_addr->protocol == protocol_name::ipc);
}
void zmq::ipc_connecter_t::process_term (int linger_)
{
if (_reconnect_timer_started) {
cancel_timer (reconnect_timer_id);
_reconnect_timer_started = false;
}
if (_handle) {
rm_handle ();
}
if (_s != retired_fd)
close ();
own_t::process_term (linger_);
}
void zmq::ipc_connecter_t::in_event ()
{
// We are not polling for incoming data, so we are actually called
@@ -180,16 +163,6 @@ int zmq::ipc_connecter_t::open ()
return -1;
}
int zmq::ipc_connecter_t::close ()
{
zmq_assert (_s != retired_fd);
int rc = ::close (_s);
errno_assert (rc == 0);
_socket->event_closed (_endpoint, _s);
_s = retired_fd;
return 0;
}
zmq::fd_t zmq::ipc_connecter_t::connect ()
{
// Following code should handle both Berkeley-derived socket