mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:37:34 +00:00
LibCore: Convert CLocalServer to ObjectPtr
This commit is contained in:
parent
c83da29a9d
commit
953cb4e436
8 changed files with 26 additions and 21 deletions
|
@ -5,11 +5,12 @@
|
|||
#include <unistd.h>
|
||||
|
||||
ASEventLoop::ASEventLoop()
|
||||
: m_server(CLocalServer::construct())
|
||||
{
|
||||
unlink("/tmp/asportal");
|
||||
m_server_sock.listen("/tmp/asportal");
|
||||
m_server_sock.on_ready_to_accept = [this] {
|
||||
auto client_socket = m_server_sock.accept();
|
||||
m_server->listen("/tmp/asportal");
|
||||
m_server->on_ready_to_accept = [this] {
|
||||
auto client_socket = m_server->accept();
|
||||
if (!client_socket) {
|
||||
dbg() << "AudioServer: accept failed.";
|
||||
return;
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
#include "ASMixer.h"
|
||||
#include <LibCore/CEventLoop.h>
|
||||
#include <LibCore/CLocalServer.h>
|
||||
#include <LibCore/CNotifier.h>
|
||||
#include "ASMixer.h"
|
||||
|
||||
class ASEventLoop
|
||||
{
|
||||
class ASEventLoop {
|
||||
public:
|
||||
ASEventLoop();
|
||||
int exec() { return m_event_loop.exec(); }
|
||||
|
||||
private:
|
||||
CEventLoop m_event_loop;
|
||||
CLocalServer m_server_sock;
|
||||
ObjectPtr<CLocalServer> m_server;
|
||||
ASMixer m_mixer;
|
||||
};
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
//#define WSMESSAGELOOP_DEBUG
|
||||
|
||||
WSEventLoop::WSEventLoop()
|
||||
: m_server(CLocalServer::construct())
|
||||
{
|
||||
m_keyboard_fd = open("/dev/keyboard", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
m_mouse_fd = open("/dev/psaux", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
|
||||
unlink("/tmp/wsportal");
|
||||
m_server_sock.listen("/tmp/wsportal");
|
||||
m_server->listen("/tmp/wsportal");
|
||||
|
||||
m_server_sock.on_ready_to_accept = [this] {
|
||||
auto client_socket = m_server_sock.accept();
|
||||
m_server->on_ready_to_accept = [this] {
|
||||
auto client_socket = m_server->accept();
|
||||
if (!client_socket) {
|
||||
dbg() << "WindowServer: accept failed.";
|
||||
return;
|
||||
|
|
|
@ -24,5 +24,5 @@ private:
|
|||
ObjectPtr<CNotifier> m_keyboard_notifier;
|
||||
int m_mouse_fd { -1 };
|
||||
ObjectPtr<CNotifier> m_mouse_notifier;
|
||||
CLocalServer m_server_sock;
|
||||
ObjectPtr<CLocalServer> m_server;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue