C# Класс 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.
Наследование: IMasterFile
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
entries IList

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

DnsSeedMasterFile() публичный Метод

Initializes a new instance of a DnsSeedMasterFile class.
public DnsSeedMasterFile ( ) : System
Результат System

DnsSeedMasterFile() публичный Метод

public DnsSeedMasterFile ( IList resourceRecords ) : System
resourceRecords IList
Результат System

DnsSeedMasterFile() публичный Метод

Initializes a new instance of a DnsSeedMasterFile class.
public DnsSeedMasterFile ( TimeSpan ttl ) : System
ttl TimeSpan The time to live.
Результат System

Get() публичный Метод

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.
Результат IList

Get() публичный Метод

Gets a list of matching IResourceRecord objects.
public Get ( Question question ) : IList
question Question The used to match on.
Результат IList

Load() публичный Метод

Loads the saved masterfile from the specified stream.
public Load ( Stream stream ) : void
stream Stream The stream containing the masterfile.
Результат void

Save() публичный Метод

Saves the cached masterfile to the specified stream.
public Save ( Stream stream ) : void
stream Stream The stream to write the masterfile to.
Результат void

Seed() публичный Метод

public Seed ( Blockcore.Features.Dns.DnsSettings dnsSettings ) : void
dnsSettings Blockcore.Features.Dns.DnsSettings
Результат void

Описание свойств

entries защищенное свойство

The resource record entries in the master file.
protected IList entries
Результат IList