C# Class Blockcore.Features.Dns.DnsSeedMasterFile

This class defines a DNS masterfile used to cache the whitelisted peers discovered by the DNS Seed service that supports saving and loading from a stream. This is based on 3rd party library https://github.com/kapetan/dns.
Inheritance: IMasterFile
Afficher le fichier Open project: x42protocol/x42-BlockCore Class Usage Examples

Protected Properties

Свойство Type Description
entries IList

Méthodes publiques

Méthode Description
DnsSeedMasterFile ( ) : System

Initializes a new instance of a DnsSeedMasterFile class.

DnsSeedMasterFile ( IList resourceRecords ) : System
DnsSeedMasterFile ( TimeSpan ttl ) : System

Initializes a new instance of a DnsSeedMasterFile class.

Get ( Domain domain, RecordType type ) : IList

Gets a list of matching IResourceRecord objects.

Get ( Question question ) : IList

Gets a list of matching IResourceRecord objects.

Load ( Stream stream ) : void

Loads the saved masterfile from the specified stream.

Save ( Stream stream ) : void

Saves the cached masterfile to the specified stream.

Seed ( Blockcore.Features.Dns.DnsSettings dnsSettings ) : void

Private Methods

Méthode Description
CreateSerializer ( ) : JsonSerializer

Creates the serializer for loading and saving the master file contents.

Matches ( Domain domain, Domain entry ) : bool

Identifies if the domain matches the entry.

Method Details

DnsSeedMasterFile() public méthode

Initializes a new instance of a DnsSeedMasterFile class.
public DnsSeedMasterFile ( ) : System
Résultat System

DnsSeedMasterFile() public méthode

public DnsSeedMasterFile ( IList resourceRecords ) : System
resourceRecords IList
Résultat System

DnsSeedMasterFile() public méthode

Initializes a new instance of a DnsSeedMasterFile class.
public DnsSeedMasterFile ( TimeSpan ttl ) : System
ttl TimeSpan The time to live.
Résultat System

Get() public méthode

Gets a list of matching IResourceRecord objects.
public Get ( Domain domain, RecordType type ) : IList
domain Domain The domain to match on.
type RecordType The type to match on.
Résultat IList

Get() public méthode

Gets a list of matching IResourceRecord objects.
public Get ( Question question ) : IList
question Question The used to match on.
Résultat IList

Load() public méthode

Loads the saved masterfile from the specified stream.
public Load ( Stream stream ) : void
stream Stream The stream containing the masterfile.
Résultat void

Save() public méthode

Saves the cached masterfile to the specified stream.
public Save ( Stream stream ) : void
stream Stream The stream to write the masterfile to.
Résultat void

Seed() public méthode

public Seed ( Blockcore.Features.Dns.DnsSettings dnsSettings ) : void
dnsSettings Blockcore.Features.Dns.DnsSettings
Résultat void

Property Details

entries protected_oe property

The resource record entries in the master file.
protected IList entries
Résultat IList