Skip to content

EntropyEngine::Networking::RemoteServer

Abstract base class for remote server connections. More…

#include <RemoteServer.h>

Inherits from EntropyEngine::Core::EntropyObject

Inherited by EntropyEngine::Networking::WebRTCServer

Name
virtual~RemoteServer() =default
virtual Result< void >listen() =0
Start listening for incoming remote connections.
virtual boolisListening() const =0
Check if the server is currently listening.
virtual Result< void >close() =0
Stop listening and close the server.
virtual ConnectionHandleaccept() =0
Accept an incoming connection (blocking).
Name
RemoteServer() =default
Protected constructor - use factory functions.

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::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
virtual ~RemoteServer() =default
virtual Result< void > listen() =0

Start listening for incoming remote connections.

Return: Result indicating success or failure with error details

Reimplemented by: EntropyEngine::Networking::WebRTCServer::listen

virtual bool isListening() const =0

Check if the server is currently listening.

Return: true if listening, false otherwise

Reimplemented by: EntropyEngine::Networking::WebRTCServer::isListening

virtual Result< void > close() =0

Stop listening and close the server.

Return: Result indicating success or failure

Reimplemented by: EntropyEngine::Networking::WebRTCServer::close

virtual ConnectionHandle accept() =0

Accept 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.

RemoteServer() =default

Protected constructor - use factory functions.

Direct instantiation is prevented to enforce factory pattern.


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