domo-iot replace libevent by libuv
This commit is contained in:
@@ -28,8 +28,6 @@
|
||||
|
||||
/*-------------------------------- INCLUDES ---------------------------------*/
|
||||
|
||||
#include <event.h>
|
||||
|
||||
#include "domo-server.h"
|
||||
|
||||
#define kDocumentRoot "."
|
||||
@@ -60,7 +58,8 @@ DomoServer::~DomoServer(void)
|
||||
*/
|
||||
bool DomoServer::setup(void)
|
||||
{
|
||||
m_evt_loop = event_base_new();
|
||||
// Create the event loop.
|
||||
m_evt_loop = uv_default_loop();
|
||||
if (m_evt_loop == NULL)
|
||||
{
|
||||
return false;
|
||||
@@ -90,8 +89,7 @@ void DomoServer::terminate(void)
|
||||
m_broker.terminate();
|
||||
|
||||
if (m_evt_loop != NULL)
|
||||
event_base_free(m_evt_loop);
|
||||
libevent_global_shutdown();
|
||||
uv_loop_close(m_evt_loop);
|
||||
}
|
||||
|
||||
/*! ----------------------------------------------------------------------------
|
||||
@@ -101,6 +99,5 @@ void DomoServer::terminate(void)
|
||||
*/
|
||||
int DomoServer::loop(void)
|
||||
{
|
||||
event_base_dispatch(m_evt_loop);
|
||||
return 0;
|
||||
return uv_run(m_evt_loop, UV_RUN_DEFAULT);;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user