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;
138 bool delete_on_close =
false);
177 typedef std::vector<ola::BaseCallback0<void>*> Callbacks;
178 typedef std::set<ola::Callback0<void>*> LoopClosureSet;
181 bool m_terminate, m_is_running;
183 std::auto_ptr<class TimeoutManager> m_timeout_manager;
184 std::auto_ptr<class PollerInterface> m_poller;
188 LoopClosureSet m_loop_callbacks;
189 Callbacks m_incoming_callbacks;
194 void DrainAndExecute();
195 void RunCallbacks(Callbacks *callbacks);
196 void SetTerminate() { m_terminate =
true; }
199 static const unsigned int POLL_INTERVAL_SECOND = 10;
200 static const unsigned int POLL_INTERVAL_USECOND = 0;
204 friend class ::SelectServerTest;
210 #endif // INCLUDE_OLA_IO_SELECTSERVER_H_