mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
8e684f0959
Fork the IPC Connection classes into Server:: and Client::ConnectionNG. The new IPC messages are serialized very snugly instead of using the same generic data structure for all messages. Remove ASAPI.h since we now generate all of it from AudioServer.ipc :^)
21 lines
641 B
C++
21 lines
641 B
C++
#include "ASEventLoop.h"
|
|
#include "ASClientConnection.h"
|
|
#include <sys/socket.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
|
|
ASEventLoop::ASEventLoop()
|
|
{
|
|
unlink("/tmp/asportal");
|
|
m_server_sock.listen("/tmp/asportal");
|
|
m_server_sock.on_ready_to_accept = [this] {
|
|
auto* client_socket = m_server_sock.accept();
|
|
if (!client_socket) {
|
|
dbg() << "AudioServer: accept failed.";
|
|
return;
|
|
}
|
|
static int s_next_client_id = 0;
|
|
int client_id = ++s_next_client_id;
|
|
IPC::Server::new_connection_ng_for_client<ASClientConnection>(*client_socket, client_id, m_mixer);
|
|
};
|
|
}
|