Class CachedNameServer
A caching name server.
Implements
Inherited Members
Namespace: Makaretu.Dns.Resolving
Assembly: Makaretu.Dns.dll
Syntax
public class CachedNameServer : NameServer, IResolver
Methods
| Improve this Doc View SourceAdd(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.
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.
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. |