holoscan::PoseTreeUCXServer
holoscan::PoseTreeUCXServer
holoscan::PoseTreeUCXServer
UCX-based server for remote PoseTree synchronization.
This class provides a server that listens for connections from PoseTreeUCXClient instances to synchronize PoseTree updates across distributed systems using UCX (Unified Communication X). The server maintains its own PoseTree instance and broadcasts updates to all connected clients.
This class is NOT thread-safe for its public methods. All public methods must be called from the same thread.
Construct a new PoseTreeUCXServer object
Construct a new PoseTreeUCXServer object.
Creates a server that will synchronize the provided PoseTree with connected clients. The server creates its own internal copy of the PoseTree to avoid conflicts with the worker thread.
Throws: std::runtime_error if pose_tree is null or not initialized.
Parameters
The PoseTree instance to synchronize. Must be initialized.
Configuration parameters for the server.
Destructor - ensures clean shutdown.
Automatically stops the server if still running, joins the worker thread, and releases all resources. Any errors during stop are logged but do not throw exceptions (no-throw guarantee).
The following overloads are deleted to prevent misuse:
Start the server on the specified port.
Starts an internal worker thread that listens for client connections and handles UCX communication. The thread runs until stop() is called or the destructor runs.
This method blocks until the server is fully started or fails to start
Only one server can listen on a given port at a time
Returns: Success (void) or error status
Parameters
The port number to listen on (must be non-zero)
Stop the server.
Signals the worker thread to stop, notifies all connected clients of shutdown, waits for the thread to finish (join), and cleans up all UCX resources. This method is automatically called by the destructor if needed.
This method is idempotent - calling it when already stopped returns success
This method blocks until the worker thread has fully stopped
Connected clients are given time to disconnect cleanly (controlled by shutdown_timeout_ms)
Returns: Success (void) or error status
Check if the server is running.
Returns: true if the server is running, false otherwise
Main worker thread function.
Handles UCX worker progress, processes client requests, and manages connections.
Convert an error code to a human readable error string.
Returns: Human-readable error string.
Parameters
Error code to convert.
Error codes used by this class.