Added DNS config.
This commit is contained in:
parent
3e41bdc552
commit
2c8f7f692c
9 changed files with 130 additions and 4 deletions
|
@ -20,6 +20,7 @@
|
|||
#define XMRIG_DNS_H
|
||||
|
||||
|
||||
#include "base/net/dns/DnsConfig.h"
|
||||
#include "base/tools/String.h"
|
||||
|
||||
|
||||
|
@ -30,6 +31,7 @@
|
|||
namespace xmrig {
|
||||
|
||||
|
||||
class DnsConfig;
|
||||
class DnsRequest;
|
||||
class IDnsBackend;
|
||||
class IDnsListener;
|
||||
|
@ -38,9 +40,13 @@ class IDnsListener;
|
|||
class Dns
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<DnsRequest> resolve(const String &host, IDnsListener *listener, uint64_t ttl = 60000);
|
||||
inline static const DnsConfig &config() { return m_config; }
|
||||
inline static void set(const DnsConfig &config) { m_config = config; }
|
||||
|
||||
static std::shared_ptr<DnsRequest> resolve(const String &host, IDnsListener *listener, uint64_t ttl = 0);
|
||||
|
||||
private:
|
||||
static DnsConfig m_config;
|
||||
static std::map<String, std::shared_ptr<IDnsBackend> > m_backends;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue