xorp

FinderTcpAutoConnector Class Reference

Class to establish and manage a single connection to a FinderTcpListener. More...

#include <finder_tcp_messenger.hh>

Inheritance diagram for FinderTcpAutoConnector:
FinderTcpConnector FinderMessengerManager

List of all members.

Public Member Functions

 FinderTcpAutoConnector (EventLoop &e, FinderMessengerManager &mm, XrlCmdMap &cmds, IPv4 host, uint16_t port, bool enabled=true, uint32_t give_up_ms=0)
void set_enabled (bool en)
bool enabled () const
bool connected () const
bool connect_failed () const

Protected Member Functions

void do_auto_connect ()
void start_timer (uint32_t ms=0)
void stop_timer ()
void messenger_birth_event (FinderMessengerBase *)
 Method called by messenger constructor.
void messenger_death_event (FinderMessengerBase *)
 Method called by messenger destructor.
void messenger_active_event (FinderMessengerBase *)
 Method called before Xrl is dispatched.
void messenger_inactive_event (FinderMessengerBase *)
 Method called immediately after Xrl is dispatched.
void messenger_stopped_event (FinderMessengerBase *)
 Method called when Messenger is unable to continue.
bool manages (const FinderMessengerBase *) const
 Method called to tell if FinderMessengerManager instance manages a particular messenger.

Protected Attributes

FinderMessengerManager_real_manager
bool _connected
bool _connect_failed
bool _enabled
bool _once_active
XorpTimer _retry_timer
XorpTimer _giveup_timer
int _last_error
size_t _consec_error

Static Protected Attributes

static const uint32_t CONNECT_RETRY_PAUSE_MS = 100
static const uint32_t CONNECT_FAILS_BEFORE_LOGGING = 10

Detailed Description

Class to establish and manage a single connection to a FinderTcpListener.

Should the connection fail after being established a new connection is started.


Member Function Documentation

void FinderTcpAutoConnector::messenger_stopped_event ( FinderMessengerBase ) [protected, virtual]

Method called when Messenger is unable to continue.

For instance, network connection lost.

Implements FinderMessengerManager.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations