Exemplo n.º 1
0
 public ServiceEndpoint(Dns.DnsServiceEntry srv)
 {
     Host     = srv.Host;
     Port     = srv.Port;
     Priority = srv.Priority;
     Weight   = srv.Weight;
     Expires  = srv.Expires;
 }
Exemplo n.º 2
0
 public static T Create <T>(Dns.DnsServiceEntry srv)
     where T : ServiceEndpoint, new()
 {
     return(new T
     {
         Host = srv.Host,
         Port = srv.Port,
         Priority = srv.Priority,
         Weight = srv.Weight,
         Expires = srv.Expires
     });
 }
Exemplo n.º 3
0
        public DnsHostEntry[] GetHostEntries(DnsServiceEntry srv)
        {
            if (_dns.AllRecords == null)
            {
                throw new InvalidOperationException("Must 'Resolve()' before getting hosts");
            }

            return((from r in _dns.AllRecords
                    let host = r as DnsHostEntry
                               where host?.Name == srv.Host
                               select host
                    ).ToArray());
        }