1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_comm_internal_ConnectionRecover_hpp
10 #define anna_comm_internal_ConnectionRecover_hpp
12 #include <anna/core/RuntimeException.hpp>
14 #include <anna/core/util/Millisecond.hpp>
27 class ConnectionRecover {
29 bool isRunning() const throw() { return a_isRunning; }
31 void annotateFault(Server* server) throw();
32 // bool contains (Server* server) const throw ();
33 // void erase (Server* server) throw ();
34 xml::Node* asXML(xml::Node* parent) const throw(RuntimeException);
37 typedef std::vector <Server*> break_container;
38 typedef break_container::iterator break_iterator;
40 comm::Communicator& a_communicator;
41 break_container a_breaks;
42 break_iterator a_recovering;
44 Millisecond a_nextTime;
46 ConnectionRecover(Communicator* communicator) : a_communicator(*communicator), a_isRunning(false) {;}
47 void tryRecover() throw();
49 friend class Communicator;