This discovery module is an implementation of the mDNS and DNS-SD protocols as defined in RFC 6762 and RFC 6763. The protocols have been fully implemented, with the exceptions called out below.

Other modules in Open Screen use this module to advertise and discover presentation displays. If you wish to provide your own implementation of DNS-SD, implement the DNS-SD public interfaces and updating the linker rules. In this case, the public discovery layer will continue to function as described below.

Note that this DNS-SD implementation is fully generic and can be used for advertisement and discovery of any RFC 6763 compliant services.

How To Use This Module

In order to use the discovery module, embedders should only need to reference the public and common directories. The DNS-SD and mDNS layers should not be accessed. In order to encourage this behavior, DEPS rules have been defined.

The config directory provides parameters needed to configure the discovery module. Specifically:

The public directory provides wrappers around the DNS-SD protocol to simplify interacting with the internals of this module:

For an example use case of this module, see the standalone sender and standalone receiver code.


This implementation has been created to fulfill the role of discovery for the CastV2 protocol. For this reason, some details or optimizations called out in the RFC documents had cost or additional required complexity that outweighed the added benefit they provided. As such, the following have not been fully implemented:

Additionally, the following limitations should be noted:

  • If network interface information is changed, the discovery stack must be re-initialized.
  • If a fatal error occurs, the discovery stack must be re-initialized.