mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-19 20:16:15 +02:00
switch from deprecated io_service to io_context
This commit is contained in:
parent
c4a61dff47
commit
1974afc176
7 changed files with 25 additions and 25 deletions
|
@ -201,17 +201,17 @@ int main(int argc, char* argv[])
|
|||
if (settings.bufferMs < 400)
|
||||
settings.bufferMs = 400;
|
||||
|
||||
asio::io_service io_service;
|
||||
std::unique_ptr<StreamServer> streamServer(new StreamServer(&io_service, settings));
|
||||
asio::io_context io_context;
|
||||
std::unique_ptr<StreamServer> streamServer(new StreamServer(&io_context, settings));
|
||||
streamServer->start();
|
||||
|
||||
auto func = [](asio::io_service* ioservice) -> void { ioservice->run(); };
|
||||
std::thread t(func, &io_service);
|
||||
auto func = [](asio::io_context* ioservice) -> void { ioservice->run(); };
|
||||
std::thread t(func, &io_context);
|
||||
|
||||
while (!g_terminated)
|
||||
chronos::sleep(100);
|
||||
|
||||
io_service.stop();
|
||||
io_context.stop();
|
||||
t.join();
|
||||
|
||||
LOG(INFO) << "Stopping streamServer" << endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue