aboutsummaryrefslogtreecommitdiffstats
path: root/src/ZeroconfAvahi.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-07 22:16:59 +0200
committerMax Kellermann <max@duempel.org>2013-08-10 13:54:23 +0200
commitc1f4f1fdb64d97b5c3461723a8482ca64efea30e (patch)
tree54c8a9c1466beec0dbfac1c0b5f5773060c1aa2b /src/ZeroconfAvahi.cxx
parent342333f72a484e9f394026666c4b20e54dc9b756 (diff)
downloadmpd-c1f4f1fdb64d97b5c3461723a8482ca64efea30e.tar.gz
mpd-c1f4f1fdb64d97b5c3461723a8482ca64efea30e.tar.xz
mpd-c1f4f1fdb64d97b5c3461723a8482ca64efea30e.zip
EventLoop: new implementation using epoll
Implement an event loop without GLib.
Diffstat (limited to '')
-rw-r--r--src/ZeroconfAvahi.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ZeroconfAvahi.cxx b/src/ZeroconfAvahi.cxx
index 619feab20..41eb2b016 100644
--- a/src/ZeroconfAvahi.cxx
+++ b/src/ZeroconfAvahi.cxx
@@ -41,7 +41,9 @@
static char *avahiName;
static int avahiRunning;
+#ifndef USE_EPOLL
static AvahiGLibPoll *avahi_glib_poll;
+#endif
static const AvahiPoll *avahi_poll;
static AvahiClient *avahiClient;
static AvahiEntryGroup *avahiGroup;
@@ -229,9 +231,14 @@ AvahiInit(EventLoop &loop, const char *serviceName)
avahiRunning = 1;
+#ifdef USE_EPOLL
+ // TODO
+ (void)loop;
+#else
avahi_glib_poll = avahi_glib_poll_new(loop.GetContext(),
G_PRIORITY_DEFAULT);
avahi_poll = avahi_glib_poll_get(avahi_glib_poll);
+#endif
avahiClient = avahi_client_new(avahi_poll, AVAHI_CLIENT_NO_FAIL,
avahiClientCallback, NULL, &error);
@@ -258,10 +265,14 @@ AvahiDeinit(void)
avahiClient = NULL;
}
+#ifdef USE_EPOLL
+ // TODO
+#else
if (avahi_glib_poll != NULL) {
avahi_glib_poll_free(avahi_glib_poll);
avahi_glib_poll = NULL;
}
+#endif
avahi_free(avahiName);
avahiName = NULL;