mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 01:40:05 +00:00
Run NTP client in the background
This commit is contained in:
parent
63e6ba7709
commit
88d968a533
6 changed files with 54 additions and 1 deletions
|
|
@ -26,7 +26,9 @@ public:
|
|||
bool error();
|
||||
std::chrono::system_clock::duration time_offset() const;
|
||||
|
||||
void Start();
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
void Open(std::string_view host, std::string_view service);
|
||||
void OpenCurrentServer();
|
||||
void Poll();
|
||||
|
|
|
|||
|
|
@ -191,6 +191,14 @@ void NtpClient::Start()
|
|||
}
|
||||
}
|
||||
|
||||
void NtpClient::Stop()
|
||||
{
|
||||
p->enabled_ = false;
|
||||
p->socket_.cancel();
|
||||
p->pollTimer_.cancel();
|
||||
p->threadPool_.join();
|
||||
}
|
||||
|
||||
void NtpClient::Open(std::string_view host, std::string_view service)
|
||||
{
|
||||
p->Open(host, service);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue