1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-21 11:25:07 +00:00
serenity/Libraries/LibCore/CLocalServer.h
Andreas Kling d6abfbdc5a LibCore: Remove ObjectPtr in favor of RefPtr
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-22 00:31:54 +02:00

26 lines
535 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 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);
int m_fd { -1 };
bool m_listening { false };
RefPtr<CNotifier> m_notifier;
};