mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 21:56:25 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user