Simplify {tcp|ipc}_connecter

The patch is meant to make the code easier to understand.
The 'wait' attribute is replaced by 'delayed_start'
and 'timer_started' attributes. The former is constant and
is initialized in the constructor. The latter is a flag
reflecting whether a timer has been started and changes during
the lifetime of the object.
This commit is contained in:
Martin Hurton
2012-06-13 02:33:02 +02:00
parent c8d0d68471
commit e0fed9d29a
4 changed files with 34 additions and 28 deletions

View File

@@ -39,11 +39,11 @@ namespace zmq
{
public:
// If 'delay' is true connecter first waits for a while, then starts
// connection process.
// If 'delayed_start' is true connecter first waits for a while,
// then starts connection process.
tcp_connecter_t (zmq::io_thread_t *io_thread_,
zmq::session_base_t *session_, const options_t &options_,
const address_t *addr_, bool delay_);
const address_t *addr_, bool delayed_start_);
~tcp_connecter_t ();
private:
@@ -97,7 +97,10 @@ namespace zmq
bool handle_valid;
// If true, connecter is waiting a while before trying to connect.
bool wait;
const bool delayed_start;
// True iff a timer has been started.
bool timer_started;
// Reference to the session we belong to.
zmq::session_base_t *session;