mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 11:44:57 +00:00
26 lines
541 B
C++
26 lines
541 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);
|
|
|
|
ObjectPtr<CLocalSocket> accept();
|
|
|
|
Function<void()> on_ready_to_accept;
|
|
|
|
private:
|
|
explicit CLocalServer(CObject* parent = nullptr);
|
|
|
|
int m_fd { -1 };
|
|
bool m_listening { false };
|
|
ObjectPtr<CNotifier> m_notifier;
|
|
};
|