Show / Hide Table of Contents

Class CachedNameServer

A caching name server.

Inheritance
Object
NameServer
CachedNameServer
Implements
IResolver
Inherited Members
NameServer.Catalog
NameServer.AnswerAllQuestions
NameServer.ResolveAsync(Message, CancellationToken)
NameServer.ResolveAsync(Question, Message, CancellationToken)
NameServer.FindAnswerAsync(Question, Message, CancellationToken)
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Makaretu.Dns.Resolving
Assembly: Makaretu.Dns.dll
Syntax
public class CachedNameServer : NameServer, IResolver

Methods

| Improve this Doc View Source

Add(Message)

Cache the response.

Declaration
public void Add(Message response)
Parameters
Type Name Description
Message response

A response from a name server.

Remarks

Both the Answers and the AdditionalRecords are added to the cache. Only resources records with a positive TTL are added.

| Improve this Doc View Source

Prune(Nullable<DateTime>)

Removes any expired resource record from the cache.

Declaration
public void Prune(DateTime? now = default(DateTime? ))
Parameters
Type Name Description
Nullable<DateTime> now

The time to use to determine if a resource record is expired. Defaults to Now.

Remarks

Authoritative nodes are not pruned.

| Improve this Doc View Source

PruneContinuously(TimeSpan)

Prune the cache in the background.

Declaration
public CancellationTokenSource PruneContinuously(TimeSpan interval)
Parameters
Type Name Description
TimeSpan interval

The delay between pruning.

Returns
Type Description
CancellationTokenSource

Allows cancelation of the background task.

See Also
Prune(Nullable<DateTime>)

Implements

IResolver
  • Improve this Doc
  • View Source
Back to top Generated by DocFX