MOD24: DNS SD listener - GoranErdeljan/TINF19C-Team-4-Service-Registry GitHub Wiki

Created by Benedict Wetzel

1. Introduction

This module can be used to listen to any new DNS-SD-Entries on the network. It is a sub-module of MOD20.

2. Requirements

The following requirements are covered by this module:

3. Prerequisites

In order to use this module the following prerequisites should be met:

  • The developer should have a working computer that can access the internet
  • The developer should use a Linux-based OS
  • The developer should have Node.js version 12.14.1 or higher installed
  • The developer should have NPM version 7.10.0 or higher installed
  • The developer should have at least some basic experience with Node.js

4. Dependencies

This module depends on the following items:

5. Technical overview

This module uses mDNS-Queries and Responses to discover services on the network. To do this it uses the DNS-SD-Mechanism.

5.1 dnssdListener.js

This file contains all functionality of the module. It exports the functions start and addCallback and depends on the multicast-dns NPM package.

Function Description
start This function starts the module. It registers a function to be called every thirty seconds that sends a mDNS-Query to request any available DNS-SD-Entries from all devices on the network. For each mDNS-Response all registered callbacks are called.
addCallback Adds a function to the list of callbacks.

5.2 package.json

Sets the dependencies and is used by NPM to install the required NPM packages