1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

SystemServer+LibCore: Implement socket takeover

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.
This commit is contained in:
Sergey Bugaev 2019-11-26 19:27:21 +03:00 committed by Andreas Kling
parent 396ad4d6b2
commit c9e21b2bcc
5 changed files with 146 additions and 10 deletions

View file

@ -10,6 +10,7 @@ class CLocalServer : public CObject {
public:
virtual ~CLocalServer() override;
bool take_over_from_system_server();
bool is_listening() const { return m_listening; }
bool listen(const String& address);
@ -20,6 +21,8 @@ public:
private:
explicit CLocalServer(CObject* parent = nullptr);
void setup_notifier();
int m_fd { -1 };
bool m_listening { false };
RefPtr<CNotifier> m_notifier;