mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
c9e21b2bcc
SystemServer can now create sockets on behalf of services before spawning any of them, and pass the open socket fd as fd 3. CLocalServer gains a method to complete the takeover and listen on the passed fd. This is not used by any services at the moment.
29 lines
604 B
C++
29 lines
604 B
C++
#pragma once
|
|
|
|
#include <LibCore/CNotifier.h>
|
|
#include <LibCore/CObject.h>
|
|
|
|
class CLocalSocket;
|
|
|
|
class CLocalServer : public CObject {
|
|
C_OBJECT(CLocalServer)
|
|
public:
|
|
virtual ~CLocalServer() override;
|
|
|
|
bool take_over_from_system_server();
|
|
bool is_listening() const { return m_listening; }
|
|
bool listen(const String& address);
|
|
|
|
RefPtr<CLocalSocket> accept();
|
|
|
|
Function<void()> on_ready_to_accept;
|
|
|
|
private:
|
|
explicit CLocalServer(CObject* parent = nullptr);
|
|
|
|
void setup_notifier();
|
|
|
|
int m_fd { -1 };
|
|
bool m_listening { false };
|
|
RefPtr<CNotifier> m_notifier;
|
|
};
|