Commit 74667ebc authored by Simon Giesecke's avatar Simon Giesecke

Problem: destructors of tcp_connecter_t, ipc_connecter_t, tipc_connecter_t contain duplicated code

Solution: pull up to stream_connecter_base_t
parent d6f8d246
...@@ -62,13 +62,6 @@ zmq::ipc_connecter_t::ipc_connecter_t (class io_thread_t *io_thread_, ...@@ -62,13 +62,6 @@ zmq::ipc_connecter_t::ipc_connecter_t (class io_thread_t *io_thread_,
zmq_assert (_addr->protocol == protocol_name::ipc); zmq_assert (_addr->protocol == protocol_name::ipc);
} }
zmq::ipc_connecter_t::~ipc_connecter_t ()
{
zmq_assert (!_reconnect_timer_started);
zmq_assert (_handle == static_cast<handle_t> (NULL));
zmq_assert (_s == retired_fd);
}
void zmq::ipc_connecter_t::process_plug () void zmq::ipc_connecter_t::process_plug ()
{ {
if (_delayed_start) if (_delayed_start)
......
...@@ -48,7 +48,6 @@ class ipc_connecter_t : public stream_connecter_base_t ...@@ -48,7 +48,6 @@ class ipc_connecter_t : public stream_connecter_base_t
const options_t &options_, const options_t &options_,
address_t *addr_, address_t *addr_,
bool delayed_start_); bool delayed_start_);
~ipc_connecter_t ();
private: private:
// ID of the timer used to delay the reconnection. // ID of the timer used to delay the reconnection.
......
...@@ -55,3 +55,10 @@ zmq::stream_connecter_base_t::stream_connecter_base_t ( ...@@ -55,3 +55,10 @@ zmq::stream_connecter_base_t::stream_connecter_base_t (
// or does not matter, change such that endpoint in initialized using an // or does not matter, change such that endpoint in initialized using an
// initializer, and make endpoint const // initializer, and make endpoint const
} }
zmq::stream_connecter_base_t::~stream_connecter_base_t ()
{
zmq_assert (!_reconnect_timer_started);
zmq_assert (!_handle);
zmq_assert (_s == retired_fd);
}
...@@ -51,6 +51,9 @@ class stream_connecter_base_t : public own_t, public io_object_t ...@@ -51,6 +51,9 @@ class stream_connecter_base_t : public own_t, public io_object_t
address_t *addr_, address_t *addr_,
bool delayed_start_); bool delayed_start_);
~stream_connecter_base_t ();
protected: protected:
// Address to connect to. Owned by session_base_t. // Address to connect to. Owned by session_base_t.
// It is non-const since some parts may change during opening. // It is non-const since some parts may change during opening.
......
...@@ -79,9 +79,6 @@ zmq::tcp_connecter_t::tcp_connecter_t (class io_thread_t *io_thread_, ...@@ -79,9 +79,6 @@ zmq::tcp_connecter_t::tcp_connecter_t (class io_thread_t *io_thread_,
zmq::tcp_connecter_t::~tcp_connecter_t () zmq::tcp_connecter_t::~tcp_connecter_t ()
{ {
zmq_assert (!_connect_timer_started); zmq_assert (!_connect_timer_started);
zmq_assert (!_reconnect_timer_started);
zmq_assert (!_handle);
zmq_assert (_s == retired_fd);
} }
void zmq::tcp_connecter_t::process_plug () void zmq::tcp_connecter_t::process_plug ()
......
...@@ -64,13 +64,6 @@ zmq::tipc_connecter_t::tipc_connecter_t (class io_thread_t *io_thread_, ...@@ -64,13 +64,6 @@ zmq::tipc_connecter_t::tipc_connecter_t (class io_thread_t *io_thread_,
zmq_assert (_addr->protocol == "tipc"); zmq_assert (_addr->protocol == "tipc");
} }
zmq::tipc_connecter_t::~tipc_connecter_t ()
{
zmq_assert (!_reconnect_timer_started);
zmq_assert (_handle == static_cast<handle_t> (NULL));
zmq_assert (_s == retired_fd);
}
void zmq::tipc_connecter_t::process_plug () void zmq::tipc_connecter_t::process_plug ()
{ {
if (_delayed_start) if (_delayed_start)
......
...@@ -49,7 +49,6 @@ class tipc_connecter_t : public stream_connecter_base_t ...@@ -49,7 +49,6 @@ class tipc_connecter_t : public stream_connecter_base_t
const options_t &options_, const options_t &options_,
address_t *addr_, address_t *addr_,
bool delayed_start_); bool delayed_start_);
~tipc_connecter_t ();
private: private:
// ID of the timer used to delay the reconnection. // ID of the timer used to delay the reconnection.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment