You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mdns.AnswerReceived += (s, e) =>
{
// Is this an answer to a service instance details?
var servers = e.Message.Answers.OfType<SRVRecord>();
foreach (var server in servers)
{
Console.WriteLine($"host '{server.Target}' for '{server.Name}'");
// Ask for the host IP addresses.
mdns.SendQuery(server.Target, type: DnsType.A);
mdns.SendQuery(server.Target, type: DnsType.AAAA);
}
// Is this an answer to host addresses?
var addresses = e.Message.Answers.OfType<AddressRecord>();
foreach (var address in addresses)
{
Console.WriteLine($"host '{address.Name}' at {address.Address}");
}
};
I cannot get the address most of time, I can only get the server.Name.
I need to call sd.QueryServiceInstances(mServiceType); many times, I finally can get address.
Is any thing I need to do?
Thanks.
The text was updated successfully, but these errors were encountered:
In your example code,
I cannot get the address most of time, I can only get the server.Name.
I need to call
sd.QueryServiceInstances(mServiceType);
many times, I finally can get address.Is any thing I need to do?
Thanks.
The text was updated successfully, but these errors were encountered: