QMdnsEngine
0.1.0
Multicast DNS library for Qt applications
|
QMdnsEngine provides an implementation of multicast DNS as per RFC 6762.
Some of QMdnsEngine's features include:
QMdnsEngine requires the following in order to build the library:
QMdnsEngine uses CMake for building the library. The options shown below allow the build to be customized:
BIN_INSTALL_DIR
- binary installation directory relative to the install prefixLIB_INSTALL_DIR
- library installation directory relative to the install prefixINCLUDE_INSTALL_DIR
- header installation directory relative to the install prefixBUILD_DOC
- build the documentation for the library with DoxygenBUILD_EXAMPLES
- build example applications that use the libraryBUILD_TESTS
- build the test suiteTo provide a service on the local network, begin by creating a Server, a Hostname, and a Provider:
The server sends and receives raw DNS packets. The hostname finds a unique hostname that is not in use to identify the device. Lastly, the provider manages the records for a service.
The next step is to create the service and update the provider:
That's it! As long as the provider remains in scope, the service will be available on the local network and other devices will be able to find it.
To find services on the local network, begin by creating a Server and a Browser:
The cache is optional but helps save time later when resolving services. The browser is provided with a service type which is used to filter services.
To receive a notification when services are added, connect to the Browser::serviceAdded() signal:
To resolve the service, use a Resolver:
Note that Resolver::resolved() may be emitted once for each address provided by the service.