1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:07:34 +00:00

LibCore: Convert CLocalServer to ObjectPtr

This commit is contained in:
Andreas Kling 2019-09-21 10:46:55 +02:00
parent c83da29a9d
commit 953cb4e436
8 changed files with 26 additions and 21 deletions

View file

@ -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;

View file

@ -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;
};