With the simple example below, I have produced a problem where no query is received when a network interface is enabled after the multicastservice has been started.
How would you update the MulticastService using NetworkInterfaceDiscovered so it receives queries again after enabling a new networkinterface ?
Thanks !
using Makaretu.Dns;
var service = "...";
var mdns = new MulticastService();
mdns.QueryReceived += (s, e) =>
{
var msg = e.Message;
if (msg.Questions.Any(q => q.Name == service))
{
var res = msg.CreateResponse();
var addresses = MulticastService.GetIPAddresses()
.Where(ip => ip.AddressFamily == AddressFamily.InterNetwork);
foreach (var address in addresses)
{
res.Answers.Add(new ARecord
{
Name = service,
Address = address
});
}
mdns.SendAnswer(res);
}
};
mdns.Start();
With the simple example below, I have produced a problem where no query is received when a network interface is enabled after the multicastservice has been started.
How would you update the MulticastService using NetworkInterfaceDiscovered so it receives queries again after enabling a new networkinterface ?
Thanks !