Skip to content

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

Name
virtual~LocalServer() =default
virtual Result< void >listen() =0
Starts listening for connections.
virtual boolisListening() const =0
Checks if server is currently listening.
virtual Result< void >close() =0
Stops listening and closes the server.
virtual ConnectionHandleaccept() =0
Accepts a connection (blocks until client connects).
Name
LocalServer() =default

Protected Classes inherited from EntropyEngine::Core::EntropyObject

Name
structHandleCore
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.
booltryRetain() const
Attempts to retain only if the object is still alive.
virtual std::stringtoString() const
Human-readable short string (class@ptr by default).
voidretain() const
Increments the reference count.
voidrelease() const
Decrements the reference count and deletes when it reaches zero.
uint32_trefCount() const
Current reference count (approximate under contention).
EntropyObject &operator=(const EntropyObject & ) =delete
EntropyObject &operator=(EntropyObject && ) =delete
boolhasHandle() const
template <class OwnerT >
OwnerT *
handleOwnerAs() const
Returns the stamped owner pointer cast to the requested type.
const void *handleOwner() const
uint32_thandleIndex() const
uint64_thandleId() const
uint32_thandleGeneration() const
WeakControlBlock *getWeakControlBlock() const
Lazily retrieves or creates the weak control block.
virtual std::stringdescription() const
Long-form description; defaults to toString().
virtual std::stringdebugString() const
Debug-oriented string including refcount and handle when present.
virtual const char *className() const
Runtime class name for diagnostics and reflection.
virtual uint64_tclassHash() 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
structHandleAccess
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);
}
}
virtual ~LocalServer() =default
virtual Result< void > listen() =0

Starts listening for connections.

Return: Result indicating success or failure

Reimplemented by: EntropyEngine::Networking::NamedPipeServer::listen, EntropyEngine::Networking::SharedMemoryServer::listen, EntropyEngine::Networking::UnixSocketServer::listen

virtual bool isListening() const =0

Checks 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

virtual Result< void > close() =0

Stops 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

virtual ConnectionHandle accept() =0

Accepts 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

LocalServer() =default

Updated on 2026-01-26 at 17:14:35 -0500