Skip to content

An simple example .NET implementation of a service discovery mechanism similar to Apple Bonjour.

License

Notifications You must be signed in to change notification settings

thgossler/ServiceDiscovery

Repository files navigation

Contributors Forks Stargazers Issues MIT License


ServiceDiscovery

A simple example .NET implementation of a distributed service discovery mechanism similar to Apple Bonjour.
Report Bug · Request Feature · Contribute · Sponsor project · Sponsor via PayPal

Description

An simple example .NET implementation of a distributed service discovery mechanism similar to Apple Bonjour. It should be compliant to the DNS Service Discovery (DNS-SD RFC 6763) over Multicast DNS (mDNS RFC 6762) standard. Support for announcing and discovering multiple services in parallel is implemented. The service to service communication can also be secured (Https) with a server certificate. The mDNS communication is not secured in this simple implementation.

Created with help of GitHub Copilot and ChatGPT.

Architecture

Architecture Diagram

Usage

Just build the project and execute the DiscoveryClient executable 3 times somewhere in the same network, like:

Computer 1: DiscoveryClient.exe 1

Computer 2: DiscoveryClient.exe 2

Computer 3: DiscoveryClient.exe 3

The 3 different instances of the executable can also be started on the same computer.

They are all just starting and waiting until the 2 others have also started and been discovered, and then they call each other in the mesh and combine their results into the output string "Hello world!" (instance 1 => "Hello", instance 2 => "world", instance 3 => "!"). All clients exit once they have achieved their goal.

The MdnsServiceDiscovery library can handle any number of clients. Just this DiscoveryClient console example app is using exactly 3 service instances to demonstate the dynamic discovery and collaboration based on roles.

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star 😉 Thanks!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Donate

If you wish to use the tool but are unable to contribute, please consider donating an amount that reflects its value to you. You can do so either via PayPal

Donate via PayPal

or via GitHub Sponsors.

License

Distributed under the MIT License. See LICENSE for more information.

About

An simple example .NET implementation of a service discovery mechanism similar to Apple Bonjour.

Topics

Resources

License

Stars

Watchers

Forks