Backport unified client timer from proxy project.

This commit is contained in:
XMRig 2017-08-14 08:41:54 +03:00
parent 5ad1a48489
commit 9975b4e4cd
13 changed files with 105 additions and 22 deletions

View file

@ -69,6 +69,12 @@ void DonateStrategy::stop()
}
void DonateStrategy::tick(uint64_t now)
{
m_client->tick(now);
}
void DonateStrategy::onClose(Client *client, int failures)
{
}

View file

@ -49,6 +49,7 @@ public:
int64_t submit(const JobResult &result) override;
void connect() override;
void stop() override;
void tick(uint64_t now) override;
protected:
void onClose(Client *client, int failures) override;

View file

@ -74,6 +74,14 @@ void FailoverStrategy::stop()
}
void FailoverStrategy::tick(uint64_t now)
{
for (Client *client : m_pools) {
client->tick(now);
}
}
void FailoverStrategy::onClose(Client *client, int failures)
{
if (failures == -1) {

View file

@ -49,6 +49,7 @@ public:
void connect() override;
void resume() override;
void stop() override;
void tick(uint64_t now) override;
protected:
void onClose(Client *client, int failures) override;

View file

@ -66,6 +66,12 @@ void SinglePoolStrategy::stop()
}
void SinglePoolStrategy::tick(uint64_t now)
{
m_client->tick(now);
}
void SinglePoolStrategy::onClose(Client *client, int failures)
{
if (!isActive()) {

View file

@ -46,6 +46,7 @@ public:
void connect() override;
void resume() override;
void stop() override;
void tick(uint64_t now) override;
protected:
void onClose(Client *client, int failures) override;