AudioServer: Port to socket takeover

This commit is contained in:
Sergey Bugaev 2019-11-26 19:33:48 +03:00 committed by Andreas Kling
parent 22a05621d5
commit bd55938985
3 changed files with 4 additions and 3 deletions

View file

@ -21,6 +21,7 @@ KeepAlive=1
User=anon
[AudioServer]
Socket=/tmp/portal/audio
Priority=high
KeepAlive=1
User=anon

View file

@ -3,7 +3,7 @@
#include <SharedBuffer.h>
AClientConnection::AClientConnection()
: ConnectionNG(*this, "/tmp/asportal")
: ConnectionNG(*this, "/tmp/portal/audio")
{
}

View file

@ -7,8 +7,8 @@
ASEventLoop::ASEventLoop()
: m_server(CLocalServer::construct())
{
unlink("/tmp/asportal");
m_server->listen("/tmp/asportal");
bool ok = m_server->take_over_from_system_server();
ASSERT(ok);
m_server->on_ready_to_accept = [this] {
auto client_socket = m_server->accept();
if (!client_socket) {