mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-03 00:29:35 +02:00
Use helper function for async_wait
PosixStream waits 100ms before reconnecting
This commit is contained in:
parent
5c79d9447d
commit
9353c61d7b
5 changed files with 36 additions and 68 deletions
|
@ -160,18 +160,7 @@ void AirplayStream::pipeReadLine()
|
|||
{
|
||||
LOG(ERROR, LOG_TAG) << "Error opening pipe: " << e.what() << "\n";
|
||||
pipe_fd_ = nullptr;
|
||||
auto self = this->shared_from_this();
|
||||
pipe_open_timer_.expires_after(std::chrono::milliseconds(500));
|
||||
pipe_open_timer_.async_wait([self, this](const boost::system::error_code& ec) {
|
||||
if (ec)
|
||||
{
|
||||
LOG(ERROR, LOG_TAG) << "Error during async wait: " << ec.message() << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
pipeReadLine();
|
||||
}
|
||||
});
|
||||
wait(pipe_open_timer_, 500ms, [this] { pipeReadLine(); });
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue