Skip to content

UCommunicationManager

A class that manages a gRPC server running on a specified URL.

class UCommunicationManager : public UObject

Methods

RegisterService

bool RegisterService(std::shared_ptr<grpc::Service> Service)

Register a service with the server.

Parameters

  • Service (std::shared_ptr<grpc::Service>)

GetCompletionQueue

std::unique_ptr<ServerCompletionQueue> GetCompletionQueue()

Get the completion queue for the server.


CreatePollingBackend

template <typename ServiceType, typename In, typename Out>
inline IConsumerBackend<In> *
CreatePollingBackend(AsyncRPCHandle<ServiceType, In, Out> TargetRPC,
std::shared_ptr<ServiceType> Service)

Create a new Polling Backend, where Unreal Polls for messages of type In.

Parameters

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>)

  • Service (std::shared_ptr<ServiceType>)


CreateProducerBackend

template <typename ServiceType, typename In, typename Out>
inline IProducerBackend<Out> *
CreateProducerBackend(AsyncRPCHandle<ServiceType, In, Out> TargetRPC,
std::shared_ptr<ServiceType> Service)

Create a new Producer Backend, where Unreal Sends messages of type Out.

Parameters

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>)

  • Service (std::shared_ptr<ServiceType>)


CreateExchangeBackend

template <typename ServiceType, typename In, typename Out>
inline IExchangeBackend<In, Out> *
CreateExchangeBackend(AsyncRPCHandle<ServiceType, In, Out> TargetRPC,
std::shared_ptr<ServiceType> Service)

Create a new Exchange Backend, where Unreal Sends messages of type Out and receives back messages of type In.

Parameters

  • TargetRPC (AsyncRPCHandle<ServiceType, In, Out>)

  • Service (std::shared_ptr<ServiceType>)


ShutdownServer

void ShutdownServer()

Shutdown the Communication manager.


StartBackends

bool StartBackends()

Starts all backends created by the communication manager.


UCommunicationManager

~UCommunicationManager()

Initialize

void Initialize(int Port, const FString &Address)

Initialize the Communication Manager.

Parameters

  • Port (int)

  • Address (const FString)

Attributes

OnServerStartDelegate

FOnServerStartSignature OnServerStartDelegate

A delegate that is called when the server starts.


OnServerReadyDelegate

FOnServerReadySignature OnServerReadyDelegate

A delegate that is called when the server is ready.


OnConnectionEstablishedDelegate

FOnServerReadySignature OnConnectionEstablishedDelegate

A delegate that is called when the server establishes a connection.


OnServerShutdownDelegate

FOnServerShutdownSignature OnServerShutdownDelegate

A delegate that is called when the server shuts down.


FRPCServerSettings

FRPCServerSettings ConnectionSettings = FRPCServerSettings()

Host and port used when starting the gRPC server and passed to Python clients.

Source: Source/ScholaProtobuf/Public/GymConnectors/gRPC/CommunicationManager.h