Skip to content

Commit b8c7f02

Browse files
committed
macOS: New implementation of service publication
The current implementation of service publication on macOS uses `avahi-client`, but the majority of macOS machines do not have Avahi installed because macOS provides a native alternative (`mDNSresponder`), meaning that there is no reason to install Avahi. The current implementation also attempts to load the Avahi client libraries using `dlopen(3)`, which has a variety of restrictions on macOS, such as only being willing to load from certain directories. Depending on where the Avahi binaries are installed, they might not be loadable through the current invocation of `dlopen(3)`. Instead of using an Avahi client on macOS, it makes more sense to use the native macOS API for publishing services via `mDNSresponder`. This commit supplies such an implementation that uses the macOS native API. It also has the advantage of being much simpler than the previous implementation. Furthermore, this new implementation works on all macOS machines, because it relies only on native APIs, rather than on third-party software that is not commonly installed on macOS.
1 parent 90fd371 commit b8c7f02

File tree

2 files changed

+61
-415
lines changed

2 files changed

+61
-415
lines changed

src/platform/linux/publish.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @file src/platform/linux/publish.cpp
33
* @brief Definitions for publishing services on Linux.
44
* @note Adapted from https://www.avahi.org/doxygen/html/client-publish-service_8c-example.html
5-
* @todo Use a common file for this and src/platform/macos/publish.cpp
65
*/
76
#include <thread>
87

0 commit comments

Comments
 (0)