UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DirectLink::FEndpoint Class Reference

#include <DirectLinkEndpoint.h>

+ Inheritance diagram for DirectLink::FEndpoint:

Public Types

enum class  EOpenStreamResult {
  Opened , AlreadyOpened , SourceAndDestinationNotFound , RemoteEndpointNotFound ,
  Unsuppported , CannotConnectToPrivate
}
 

Public Member Functions

UE_API FEndpoint (const FString &InName)
 
UE_API ~FEndpoint ()
 
UE_API void SetVerbose (bool bVerbose=true)
 
UE_API FSourceHandle AddSource (const FString &Name, EVisibility Visibility=EVisibility::Public)
 
UE_API void RemoveSource (const FSourceHandle &Source)
 
UE_API void SetSourceRoot (const FSourceHandle &Source, ISceneGraphNode *InRoot, bool bSnapshot)
 
UE_API void SnapshotSource (const FSourceHandle &Source)
 
UE_API FDestinationHandle AddDestination (const FString &Name, EVisibility Visibility, const TSharedPtr< class IConnectionRequestHandler > &ConnectionRequestHandler)
 
UE_API void RemoveDestination (const FDestinationHandle &Destination)
 
UE_API FRawInfo GetRawInfoCopy () const
 
UE_API void AddEndpointObserver (IEndpointObserver *Observer)
 
UE_API void RemoveEndpointObserver (IEndpointObserver *Observer)
 
UE_API EOpenStreamResult OpenStream (const FSourceHandle &SourceId, const FDestinationHandle &DestinationId)
 
UE_API void CloseStream (const FSourceHandle &SourceId, const FDestinationHandle &DestinationId)
 

Additional Inherited Members

- Protected Member Functions inherited from FNoncopyable
 FNoncopyable ()
 
 ~FNoncopyable ()
 

Detailed Description

FEndpoint class is the main interface for sending and receiving data with the DirectLink system.

Instances of this class discover themselves (through MessageBus) and can see Sources and Destinations available on each others. This is automatic and works for multiple applications. With that system, one can expose data from an application and consume it from another.

An endpoint can exposes N sources and N Destinations. That being said, a more classic setup is to have an 'exporter' process that only exposes sources, and some 'consumer' process that only have Destinations.

As a convention, 'consumers' have the responsibility to handle the connections management. Exporters have the sole responsibility to exposes their data.

Setup example:

  • Exporter process
    • Source "My First Source"
    • Source "My Second Source"
  • Consumer process
    • Destination "Viewport"

The consumer process can handle the connections between Sources and Destinations with the OpenStream and CloseStream methods.

Member Enumeration Documentation

◆ EOpenStreamResult

Enumerator
Opened 
AlreadyOpened 
SourceAndDestinationNotFound 
RemoteEndpointNotFound 
Unsuppported 
CannotConnectToPrivate 

Constructor & Destructor Documentation

◆ FEndpoint()

DirectLink::FEndpoint::FEndpoint ( const FString &  InName)

◆ ~FEndpoint()

DirectLink::FEndpoint::~FEndpoint ( )

Member Function Documentation

◆ AddDestination()

FDestinationHandle DirectLink::FEndpoint::AddDestination ( const FString &  Name,
EVisibility  Visibility,
const TSharedPtr< class IConnectionRequestHandler > &  ConnectionRequestHandler 
)

Add a Destination on that endpoint

Parameters
NameName of that destination
VisibilityWhether this destination should be visible to remote endpoints
ConnectionRequestHandlerObject that will handle connections requests from Sources
Returns
A handle to the new destination

◆ AddEndpointObserver()

void DirectLink::FEndpoint::AddEndpointObserver ( IEndpointObserver Observer)

Register an IEndpointObserver that will be notified periodically with the last state of the swarm.

Parameters
ObserverObject that should be notified

◆ AddSource()

FSourceHandle DirectLink::FEndpoint::AddSource ( const FString &  Name,
EVisibility  Visibility = EVisibility::Public 
)

Add a Source to that endpoint. A source can hold content (a scene snapshot) and is able to stream that content to remote destinations.

Parameters
NameUser facing name for this source.
VisibilityWhether that Source is visible to remote endpoints
Returns
A Handle required by other Source related methods

◆ CloseStream()

void DirectLink::FEndpoint::CloseStream ( const FSourceHandle SourceId,
const FDestinationHandle DestinationId 
)

Close a previously opened stream

Parameters
SourceIdHandle to the Source
DestinationIdHandle to the Destination

◆ GetRawInfoCopy()

FRawInfo DirectLink::FEndpoint::GetRawInfoCopy ( ) const

Get a snapshot of the current state of the DirectLink swarm. It includes discovered Endpoints, their sources and destinations, and the streams descriptions.

Returns
Description of the last state of swarm

◆ OpenStream()

FEndpoint::EOpenStreamResult DirectLink::FEndpoint::OpenStream ( const FSourceHandle SourceId,
const FDestinationHandle DestinationId 
)

Open a Stream between a Source and a Destination

Parameters
SourceIdHandle to the Source
DestinationIdHandle to the Destination
Returns
Whether the stream is correctly opened

◆ RemoveDestination()

void DirectLink::FEndpoint::RemoveDestination ( const FDestinationHandle Destination)

Disconnect all streams related to that destination and removes the Destination itself from that endpoint

Parameters
DestinationHandle of the destination to remove

◆ RemoveEndpointObserver()

void DirectLink::FEndpoint::RemoveEndpointObserver ( IEndpointObserver Observer)

Removes a previously added observer

Parameters
ObserverObserver to remove

◆ RemoveSource()

void DirectLink::FEndpoint::RemoveSource ( const FSourceHandle Source)

Closes all streams related to this Source and remove it from the endpoint.

Parameters
SourceHandle of the source to remove

◆ SetSourceRoot()

void DirectLink::FEndpoint::SetSourceRoot ( const FSourceHandle Source,
ISceneGraphNode InRoot,
bool  bSnapshot 
)

Set the root of the content that should be exposed from that source.

Parameters
SourceHandle of the source to setup
InRootRoot of the graph that should be exposed
bSnapshotWhether the graph should be snapshotted right away

◆ SetVerbose()

void DirectLink::FEndpoint::SetVerbose ( bool  bVerbose = true)

◆ SnapshotSource()

void DirectLink::FEndpoint::SnapshotSource ( const FSourceHandle Source)

Use the Source root to discover the graph and snapshot the content in its current state.

Parameters
SourceHandle of the source to snapshot

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