Add keepalive comment messages, per spec

This commit is contained in:
flamingcow
2019-05-12 11:18:59 -07:00
parent b079f48367
commit 9162799be0
9 changed files with 140 additions and 8 deletions

23
keepalive.h Normal file
View File

@@ -0,0 +1,23 @@
#pragma once
#include <thread>
#include "index.h"
namespace firesse {
class KeepAlive {
public:
KeepAlive(const std::chrono::nanoseconds& max_stale, Index* index);
void Start();
void Stop();
private:
const std::chrono::nanoseconds max_stale_;
Index* index_;
int shutdown_;
std::thread thread_;
};
} // namespace firesse