Skip to content

Class UCommunicationManager

Class UCommunicationManager

  • Defined in File CommunicationManager.h

Inheritance Relationships

Base Type

  • public UObject
class UCommunicationManager : public UObject

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

Dependencies: FRPCServerSettings, IConsumerBackend, IExchangeBackend, IProducerBackend

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


Public Functions

SymbolDetails
RegisterServiceRegister a service with the server.
GetCompletionQueueGet the completion queue for the server.
CreatePollingBackendCreate a new Polling Backend, where Unreal Polls for messages of type In.
CreateProducerBackendCreate a new Producer Backend, where Unreal Sends messages of type Out.
CreateExchangeBackendCreate a new Exchange Backend, where Unreal Sends messages of type Out and receives back messages of type In.
ShutdownServerShutdown the Communication manager.
StartBackendsStarts all backends created by the communication manager.
~UCommunicationManager
InitializeInitialize the Communication Manager.

RegisterService

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

Register a service with the server.

Parameters

Service – [in] The service to register

Returns:

True if the service was registered successfully, false otherwise

#DirectionNameTypeDescription
1Servicestd::shared_ptr< grpc::Service >The service to register

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp

GetCompletionQueue

std::unique_ptr<ServerCompletionQueue> GetCompletionQueue()

Get the completion queue for the server.

Returns:

The completion queue

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp

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.

Template Parameters:

  • ServiceType – The type of the service

  • In – The type of the input message

  • Out – The type of the output message

Parameters

  • TargetRPC – The RPC method to wrap

  • Service – The service to attach the backend to

#DirectionNameTypeDescription
1TargetRPCAsyncRPCHandle< ServiceType, In, Out >The RPC method to wrap
2Servicestd::shared_ptr< ServiceType >The service to attach the backend to

Attributes: inline

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

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.

Template Parameters:

  • ServiceType – The type of the service

  • In – The type of the input message

  • Out – The type of the output message

Parameters

  • TargetRPC – The RPC method to wrap

  • Service – The service to attach the backend to

#DirectionNameTypeDescription
1TargetRPCAsyncRPCHandle< ServiceType, In, Out >The RPC method to wrap
2Servicestd::shared_ptr< ServiceType >The service to attach the backend to

Attributes: inline

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

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.

Template Parameters:

  • ServiceType – The type of the service

  • In – The type of the input message

  • Out – The type of the output message

Parameters

  • TargetRPC – The RPC method to wrap

  • Service – The service to attach the backend to

#DirectionNameTypeDescription
1TargetRPCAsyncRPCHandle< ServiceType, In, Out >The RPC method to wrap
2Servicestd::shared_ptr< ServiceType >The service to attach the backend to

Attributes: inline

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

ShutdownServer

void ShutdownServer()

Shutdown the Communication manager.

Triggers OnServerShutdownDelegate

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp

StartBackends

bool StartBackends()

Starts all backends created by the communication manager.

Triggers OnServerStartDelegate and OnServerReadyDelegate

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp


~UCommunicationManager

~UCommunicationManager()

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp

Initialize

void Initialize(int Port, const FString &Address)

Initialize the Communication Manager.

Sets the Port and URL for the server from the Settings Panel

#DirectionNameTypeDescription
1Portint
2Addressconst FString &

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/CommunicationManager.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/CommunicationManager.cpp


Public Members

SymbolDetails
OnServerStartDelegateA delegate that is called when the server starts.
OnServerReadyDelegateA delegate that is called when the server is ready.
OnConnectionEstablishedDelegateA delegate that is called when the server establishes a connection.
OnServerShutdownDelegateA delegate that is called when the server shuts down.
ConnectionSettings

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.


ConnectionSettings

FRPCServerSettings ConnectionSettings = FRPCServerSettings()