21 #ifndef INCLUDE_OLA_IO_SELECTSERVER_H_
22 #define INCLUDE_OLA_IO_SELECTSERVER_H_
25 #include <ola/Clock.h>
28 #include <ola/io/SelectServerInterface.h>
29 #include <ola/network/Socket.h>
30 #include <ola/thread/Thread.h>
36 class SelectServerTest;
124 bool delete_on_close =
false);
163 typedef std::vector<ola::BaseCallback0<void>*> Callbacks;
164 typedef std::set<ola::Callback0<void>*> LoopClosureSet;
167 bool m_terminate, m_is_running;
169 std::auto_ptr<class TimeoutManager> m_timeout_manager;
170 std::auto_ptr<class PollerInterface> m_poller;
174 LoopClosureSet m_loop_callbacks;
175 Callbacks m_incoming_callbacks;
180 void DrainAndExecute();
181 void RunCallbacks(Callbacks *callbacks);
182 void SetTerminate() { m_terminate =
true; }
185 static const unsigned int POLL_INTERVAL_SECOND = 10;
186 static const unsigned int POLL_INTERVAL_USECOND = 0;
190 friend class ::SelectServerTest;
196 #endif // INCLUDE_OLA_IO_SELECTSERVER_H_