e67e7a20bd
* fix keepalive
28 lines
368 B
C++
28 lines
368 B
C++
#include "event.hpp"
|
|
#include <cassert>
|
|
|
|
namespace nntpchan
|
|
{
|
|
Mainloop::Mainloop()
|
|
{
|
|
m_loop = uv_default_loop();
|
|
assert(uv_loop_init(m_loop) == 0);
|
|
}
|
|
|
|
Mainloop::~Mainloop()
|
|
{
|
|
uv_loop_close(m_loop);
|
|
}
|
|
|
|
void Mainloop::Stop()
|
|
{
|
|
uv_stop(m_loop);
|
|
}
|
|
|
|
void Mainloop::Run(uv_run_mode mode)
|
|
{
|
|
assert(uv_run(m_loop, mode) == 0);
|
|
}
|
|
|
|
}
|