Skip to content

Support multiple FreeRTOS mDNS instances - #57

Draft
bgewehr wants to merge 1 commit into
NIBEGroup:mainfrom
bgewehr:fix/mdns-freertos-multi-instance
Draft

Support multiple FreeRTOS mDNS instances#57
bgewehr wants to merge 1 commit into
NIBEGroup:mainfrom
bgewehr:fix/mdns-freertos-multi-instance

Conversation

@bgewehr

@bgewehr bgewehr commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Problem

Follow-up to #35 and complementary to the per-DeviceLocal event isolation in #44: the FreeRTOS mDNS backend still routes asynchronous query completion through one process-global mdns_inst. With multiple OpenEEBUS services, only the last-created instance receives query completion. Stopping one instance also calls mdns_free(), which tears down the daemon shared by the other instances and the host application.

Change

  • use the synchronous mdns_query_ptr() API from each instance's existing browser thread, removing the global callback owner;
  • retain browsing and the existing update interval;
  • remove only the service entry registered by the stopping instance;
  • keep the shared mDNS daemon running;
  • initialize and release per-instance thread/semaphore resources; and
  • track successful service registration so partial construction and repeated stop remain safe.

No public OpenEEBUS API changes are introduced.

Verification

  • clang-format 18: clean
  • ESP32-S3 Xtensa / ESP-IDF 5.5.4 target object: compiled successfully
  • GCC 14 / Debian Trixie: complete host test suite passed

The target compile used Espressif mDNS 1.11.0, where multiple service instances are enabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants