crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs | LICENSE

dispatchmode (501B)


      1 #ifndef _DISPATCHMODE_
      2 #define _DISPATCHMODE_
      3 
      4 #include "sys/sys"
      5 
      6 using namespace std;
      7 
      8 class Dispatchmode {
      9 public:
     10 
     11     enum Mode {
     12 	m_leastconn,
     13 	m_roundrobin,
     14 	m_firstactive,
     15 	m_external,
     16 	m_strict_hashed_ip,
     17 	m_lax_hashed_ip,
     18 	m_strict_stored_ip,
     19 	m_lax_stored_ip,
     20 	m_weighted_load,
     21     };
     22 
     23     Dispatchmode() : mymode(m_leastconn) {
     24     }
     25 
     26     void mode (Mode m) 			{ mymode = m; }
     27     Mode mode() const 			{ return (mymode); }
     28     string modestr() const;
     29 
     30 private:
     31     Mode mymode;
     32 };
     33 
     34 #endif