Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.13 KB

ms.md

File metadata and controls

38 lines (28 loc) · 1.13 KB

Multicast Service

The MulticastService implements RFC 6762 - Multicast DNS. It sends and receives messages via multicast; basically broadcasting the message to all interested parties on the link local network(s). A message is a standard DNS message.

Sending messages

The SendQuery and SendAnswer methods are used to send a message. Note that the sending MulticastService will also receive the message.

using Makaretu.Dns;

var mdns = new MulticastService();
mdns.SendQuery("appletv.local");

Receiving messages

The QueryReceived or AnswerReceived event is raised whenever a message is received.

using Makaretu.Dns;

var mdns = new MulticastService();
mdns.AnswerReceived += (s, e) => 
{ 
   // do something with e.Message 
};
mdns.Start();

Duplicate messages