domo-iot replace libevent by libuv

This commit is contained in:
2019-12-03 22:38:01 +01:00
parent e5bd19f12d
commit 524a9f3928
6 changed files with 49 additions and 58 deletions

View File

@@ -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);;
}