MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Core::INetworkBackend Class Referenceabstract

Abstract interface for network transport backends. More...

#include <NetworkBackend.hpp>

+ Inheritance diagram for MayaFlux::Core::INetworkBackend:
+ Collaboration diagram for MayaFlux::Core::INetworkBackend:

Public Member Functions

virtual void close_endpoint (uint64_t endpoint_id)=0
 Close an endpoint and release its resources.
 
virtual EndpointState get_endpoint_state (uint64_t endpoint_id) const =0
 Query the current state of an endpoint.
 
virtual std::vector< EndpointInfoget_endpoints () const =0
 List all endpoints currently managed by this backend.
 
virtual std::string get_name () const =0
 
virtual NetworkTransport get_transport () const =0
 
virtual std::string get_version () const =0
 
virtual bool initialize ()=0
 Initialise backend resources (sockets, SHM segments, etc.)
 
virtual bool is_initialized () const =0
 
virtual bool is_running () const =0
 
virtual uint64_t open_endpoint (const EndpointInfo &info)=0
 Open a new endpoint.
 
virtual bool send (uint64_t endpoint_id, const uint8_t *data, size_t size)=0
 Send data through an endpoint.
 
virtual bool send_to (uint64_t endpoint_id, const uint8_t *data, size_t size, const std::string &address, uint16_t port)=0
 Send data to a specific address through an endpoint.
 
virtual void set_receive_callback (NetworkReceiveCallback callback)=0
 Register the receive callback.
 
virtual void set_state_callback (EndpointStateCallback callback)=0
 Register the endpoint state change callback.
 
virtual void shutdown ()=0
 Release all resources, close all endpoints.
 
virtual void start ()=0
 Start receive threads and accept connections.
 
virtual void stop ()=0
 Stop receive threads without releasing resources.
 
virtual ~INetworkBackend ()=default
 

Detailed Description

Abstract interface for network transport backends.

Follows the same lifecycle and structural pattern as IInputBackend: initialize() -> start() -> [running] -> stop() -> shutdown()

Each concrete implementation (UDP, TCP, SharedMemory) owns sockets or shared segments, manages background receive threads, and exposes a uniform endpoint model. The NetworkSubsystem owns backends and routes high-level operations through this interface.

Bidirectional: sends and receives, manages persistent endpoints rather than devices. This is the core structural difference from IInputBackend.

Backends are deliberately synchronous and callback-based. They know nothing about coroutines. The coroutine surface lives in NetworkService and is implemented by NetworkSubsystem using callbacks internally to resume suspended coroutines. This keeps backends simple (pure OS socket wrappers) and avoids coupling transport code to the Vruta/Kriya stack.

Endpoint lifecycle: open_endpoint(info) -> endpoint_id send(endpoint_id, data, size) [receive via callback] close_endpoint(endpoint_id)

Future transport backends (WebRTC, GStreamer, etc.) implement this same interface. Protocol-level orchestration above raw transport (codec pipelines, session management, jitter buffering) belongs in a future Portal::Network layer, not here.

Definition at line 64 of file NetworkBackend.hpp.


The documentation for this class was generated from the following file: