EntropyEngine::Networking::RemoteServer
EntropyEngine::Networking::RemoteServer
Section titled “EntropyEngine::Networking::RemoteServer”Abstract base class for remote server connections. More…
#include <RemoteServer.h>
Inherits from EntropyEngine::Core::EntropyObject
Inherited by EntropyEngine::Networking::WebRTCServer
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| virtual | ~RemoteServer() =default |
| virtual Result< void > | listen() =0 Start listening for incoming remote connections. |
| virtual bool | isListening() const =0 Check if the server is currently listening. |
| virtual Result< void > | close() =0 Stop listening and close the server. |
| virtual ConnectionHandle | accept() =0 Accept an incoming connection (blocking). |
Protected Functions
Section titled “Protected Functions”| Name | |
|---|---|
| RemoteServer() =default Protected constructor - use factory functions. |
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::RemoteServer;Abstract base class for remote server connections.
RemoteServer provides an abstract interface for remote connection servers, analogous to LocalServer but for network-based transports. Concrete implementations handle specific protocols (WebRTC, QUIC, etc.).
Design Philosophy:
- Match LocalServer interface exactly for consistency
- Abstract away protocol-specific details
- Blocking accept() pattern for simplicity
- Factory pattern for instantiation
Usage:
auto server = createRemoteServer(&connMgr, 8080);auto listenResult = server->listen();if (listenResult.success()) { auto conn = server->accept(); // Blocks until client connects}Thread Safety:
- Implementations must be thread-safe
- accept() may be called from multiple threads
- close() must be safe to call from any thread
Public Functions Documentation
Section titled “Public Functions Documentation”function ~RemoteServer
Section titled “function ~RemoteServer”virtual ~RemoteServer() =defaultfunction listen
Section titled “function listen”virtual Result< void > listen() =0Start listening for incoming remote connections.
Return: Result indicating success or failure with error details
Reimplemented by: EntropyEngine::Networking::WebRTCServer::listen
function isListening
Section titled “function isListening”virtual bool isListening() const =0Check if the server is currently listening.
Return: true if listening, false otherwise
Reimplemented by: EntropyEngine::Networking::WebRTCServer::isListening
function close
Section titled “function close”virtual Result< void > close() =0Stop listening and close the server.
Return: Result indicating success or failure
Reimplemented by: EntropyEngine::Networking::WebRTCServer::close
function accept
Section titled “function accept”virtual ConnectionHandle accept() =0Accept an incoming connection (blocking).
Return: ConnectionHandle for the new connection, or invalid handle if closed
Reimplemented by: EntropyEngine::Networking::WebRTCServer::accept
Blocks until a client connects or the server is closed. Uses internal polling with acceptPollIntervalMs to check for shutdown while waiting.
Protected Functions Documentation
Section titled “Protected Functions Documentation”function RemoteServer
Section titled “function RemoteServer”RemoteServer() =defaultProtected constructor - use factory functions.
Direct instantiation is prevented to enforce factory pattern.
Updated on 2026-01-26 at 17:14:35 -0500