Exemplo n.º 1
0
        /// <summary>
        /// Initialises a new instance of the DnsRecord class and specifies the
        /// owner name, the resource record class and the TTL of the record.
        /// </summary>
        /// <param name="owner">The owner name.</param>
        /// <param name="type">The class of resource record.</param>
        /// <param name="cls">The class of resource record.</param>
        /// <param name="ttl">The TTL.</param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when <paramref name="owner"/> is <see langword="null"/>.
        /// </exception>
        protected DnsRecord(DnsName owner, DnsRecordType type, DnsRecordClass cls, TimeSpan ttl)
        {
            Guard.NotNull(owner, "owner");

            _owner   = owner;
            _type    = type;
            _class   = cls;
            _ttl     = ttl;
            _expires = DnsClock.Now() + ttl;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns a value indicating if this resource record is alive.
 /// </summary>
 public bool IsAlive()
 {
     return(IsAlive(DnsClock.Now()));
 }