mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-22 20:47:05 +02:00
Use callback function instead of class
This commit is contained in:
parent
efd050a716
commit
f0985cbce4
4 changed files with 40 additions and 33 deletions
|
@ -114,8 +114,8 @@ void ProcessStream::connect()
|
|||
on_connect();
|
||||
if (wd_timeout_sec_ > 0)
|
||||
{
|
||||
watchdog_ = make_unique<Watchdog>(strand_, this);
|
||||
watchdog_->start(std::chrono::seconds(wd_timeout_sec_));
|
||||
watchdog_ = make_unique<Watchdog>(strand_);
|
||||
watchdog_->start(std::chrono::seconds(wd_timeout_sec_), [this](std::chrono::milliseconds ms) { onTimeout(ms); });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -171,7 +171,7 @@ void ProcessStream::stderrReadLine()
|
|||
}
|
||||
|
||||
|
||||
void ProcessStream::onTimeout(const Watchdog& /*watchdog*/, std::chrono::milliseconds ms)
|
||||
void ProcessStream::onTimeout(std::chrono::milliseconds ms)
|
||||
{
|
||||
LOG(ERROR, LOG_TAG) << "Watchdog timeout: " << ms.count() / 1000 << "s\n";
|
||||
if (process_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue