public void Resolve(string protocol, params IPEndPoint[] endpoints) { if (!protocol.EndsWith(".")) { if (protocol.EndsWith(".local")) { protocol += "."; } else { protocol += ".local."; } } else { if (!protocol.EndsWith("local.")) { protocol += "local."; } } protocols.Add(protocol); if (client == null) { client = new MDnsServer(endpoints); client.AnswerReceived += client_AnswerReceived; client.Resolve(protocol); } else { client.Resolve(protocol); } }
public void Publish() { publisher = new MDnsServer(); publisher.QueryReceived += publisher_QueryReceived; publisher.StartUdp(); Renew(500); }
public void Resolve() { if (resolver != null) resolver.Stop(); if (HostName == null) { needsToBeResolvedLater = true; return; } needsToBeResolvedLater = false; resolver = new MDnsServer().Resolve(HostName); resolver.AnswerReceived += client_AnswerReceived; resolver.StartUdp(); resolved.WaitOne(); }
public void Resolve() { if (resolver != null) { resolver.Stop(); } if (HostName == null) { needsToBeResolvedLater = true; return; } needsToBeResolvedLater = false; resolver = new MDnsServer().Resolve(HostName); resolver.AnswerReceived += client_AnswerReceived; resolver.StartUdp(); resolved.WaitOne(); }
public void Resolve(string protocol) { if (!protocol.EndsWith(".")) { if (protocol.EndsWith(".local")) protocol += "."; else protocol += ".local."; } else { if (!protocol.EndsWith("local.")) protocol += "local."; } protocols.Add(protocol); if (client == null) { client = new MDnsServer(); client.AnswerReceived += client_AnswerReceived; client.Resolve(protocol); } else client.Resolve(protocol); }