EntropyEngine::Networking::LocalServer
EntropyEngine::Networking::LocalServer
Section titled “EntropyEngine::Networking::LocalServer”Platform-agnostic local server for accepting IPC connections. More…
#include <LocalServer.h>
Inherits from EntropyEngine::Core::EntropyObject
Inherited by EntropyEngine::Networking::NamedPipeServer, EntropyEngine::Networking::SharedMemoryServer, EntropyEngine::Networking::UnixSocketServer
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual | ~LocalServer() =default |
| virtual Result< void > | listen() =0 Starts listening for connections. |
| virtual bool | isListening() const =0 Checks if server is currently listening. |
| virtual Result< void > | close() =0 Stops listening and closes the server. |
| virtual ConnectionHandle | accept() =0 Accepts a connection (blocks until client connects). |
Protected Functions
Section titled “Protected Functions”| Name | |
|---|---|
| LocalServer() =default |
Additional inherited members
Section titled “Additional inherited members”Protected Classes inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| struct | HandleCore Optional handle identity stamped by an owner/registry. |
Public Functions inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| virtual | ~EntropyObject() =default |
| virtual const TypeSystem::TypeInfo * | typeInfo() const Optional richer type information; may be null. |
| bool | tryRetain() const Attempts to retain only if the object is still alive. |
| virtual std::string | toString() const Human-readable short string (class@ptr by default). |
| void | retain() const Increments the reference count. |
| void | release() const Decrements the reference count and deletes when it reaches zero. |
| uint32_t | refCount() const Current reference count (approximate under contention). |
| EntropyObject & | operator=(const EntropyObject & ) =delete |
| EntropyObject & | operator=(EntropyObject && ) =delete |
| bool | hasHandle() const |
| template <class OwnerT > OwnerT * | handleOwnerAs() const Returns the stamped owner pointer cast to the requested type. |
| const void * | handleOwner() const |
| uint32_t | handleIndex() const |
| uint64_t | handleId() const |
| uint32_t | handleGeneration() const |
| WeakControlBlock * | getWeakControlBlock() const Lazily retrieves or creates the weak control block. |
| virtual std::string | description() const Long-form description; defaults to toString(). |
| virtual std::string | debugString() const Debug-oriented string including refcount and handle when present. |
| virtual const char * | className() const Runtime class name for diagnostics and reflection. |
| virtual uint64_t | classHash() const Stable type hash for cross-language identification. |
| EntropyObject() =default | |
| EntropyObject(EntropyObject && ) =delete | |
| EntropyObject(const EntropyObject & ) =delete |
Protected Functions inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| void | _setHandleIdentity(void * owner, uint32_t index, uint32_t generation) |
| void | _clearHandleIdentity() |
Protected Attributes inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| std::atomic< WeakControlBlock * > | _weakBlock Lazily allocated control block for weak refs. |
| std::atomic< uint32_t > | _refCount Thread-safe retain/release counter. |
| struct EntropyEngine::Core::EntropyObject::HandleCore | _handle |
Friends inherited from EntropyEngine::Core::EntropyObject
| Name | |
|---|---|
| struct | HandleAccess |
Detailed Description
Section titled “Detailed Description”class EntropyEngine::Networking::LocalServer;Platform-agnostic local server for accepting IPC connections.
LocalServer provides a cross-platform abstraction for server-side local connections. It handles:
- Unix domain sockets on Linux/macOS
- Named pipes on Windows (future)
- XPC on macOS (future)
Derives from EntropyObject for type system integration and debugging.
Usage:
ConnectionManager connMgr(64);LocalServer server(&connMgr, "/tmp/server.sock");
auto result = server.listen();if (result.failed()) { ... }
// Accept connections (blocking)while (running) { auto conn = server.accept(); if (conn.valid()) { conn.send(data); }}Public Functions Documentation
Section titled “Public Functions Documentation”function ~LocalServer
Section titled “function ~LocalServer”virtual ~LocalServer() =defaultfunction listen
Section titled “function listen”virtual Result< void > listen() =0Starts listening for connections.
Return: Result indicating success or failure
Reimplemented by: EntropyEngine::Networking::NamedPipeServer::listen, EntropyEngine::Networking::SharedMemoryServer::listen, EntropyEngine::Networking::UnixSocketServer::listen
function isListening
Section titled “function isListening”virtual bool isListening() const =0Checks if server is currently listening.
Return: true if listening for connections
Reimplemented by: EntropyEngine::Networking::NamedPipeServer::isListening, EntropyEngine::Networking::SharedMemoryServer::isListening, EntropyEngine::Networking::UnixSocketServer::isListening
function close
Section titled “function close”virtual Result< void > close() =0Stops listening and closes the server.
Return: Result indicating success or failure
Reimplemented by: EntropyEngine::Networking::NamedPipeServer::close, EntropyEngine::Networking::SharedMemoryServer::close, EntropyEngine::Networking::UnixSocketServer::close
function accept
Section titled “function accept”virtual ConnectionHandle accept() =0Accepts a connection (blocks until client connects).
Return: ConnectionHandle for the accepted connection, or invalid handle on error
Reimplemented by: EntropyEngine::Networking::NamedPipeServer::accept, EntropyEngine::Networking::SharedMemoryServer::accept, EntropyEngine::Networking::UnixSocketServer::accept
Protected Functions Documentation
Section titled “Protected Functions Documentation”function LocalServer
Section titled “function LocalServer”LocalServer() =defaultUpdated on 2026-01-26 at 17:14:35 -0500