mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-31 18:06:15 +02:00
stream server uses async send and receive
This commit is contained in:
parent
6a3f59b0e1
commit
2f06ebed04
8 changed files with 185 additions and 218 deletions
|
@ -265,11 +265,10 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
boost::asio::io_context io_context;
|
||||
std::unique_ptr<StreamServer> streamServer(new StreamServer(&io_context, settings));
|
||||
std::unique_ptr<StreamServer> streamServer(new StreamServer(io_context, settings));
|
||||
streamServer->start();
|
||||
|
||||
auto func = [](boost::asio::io_context* ioservice) -> void { ioservice->run(); };
|
||||
std::thread t(func, &io_context);
|
||||
std::thread t([&] { io_context.run(); });
|
||||
|
||||
while (!g_terminated)
|
||||
chronos::sleep(100);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue