Navigation
API > API/Plugins > API/Plugins/QuicMessagingTransport
QUIC endpoint manager
Authentication:
- If AuthenticationMode is Enabled, QuicServerHandler will discard any message with MessageType other than "Authentication" until the node associated with the handler is marked as authenticated
- Messages with type "Authentication" or "AuthenticationResponse" can be sent via the extension methods found in IQuicNetworkMessagingExtension.h
- The MaxAuthenticationMessageSize limit can be set to avoid reading potentially large malicious authentication messages
Client/Server:
- The EndpointManager will start in client mode by default and is converted to a server endpoint when SetServerMode is called with additional parameters needed to run a server
- QuicServerHandlers will continuously ping the connected client to keep the connection alive
| Name | FQuicEndpointManager |
| Type | class |
| Header File | /Engine/Plugins/Experimental/QuicMessaging/Source/QuicMessagingTransport/Public/QuicEndpointManager.h |
| Include Path | #include "QuicEndpointManager.h" |
Syntax
class FQuicEndpointManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| QuicEndpointManager.h | |||
FQuicEndpointManager
(
TSharedRef< FQuicEndpointConfig > InEndpointConfig |
Initialize endpoint manager with default mode as client. | QuicEndpointManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FQuicEndpointManager() |
Default destructor. | QuicEndpointManager.h |
Structs
| Name | Remarks |
|---|---|
| FDiscoveryTimeoutEntry |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnClientConnectionChanged | TBaseDelegate_ThreeParams< void, const FGuid &, const FIPv4Endpoint &, const EQuicClientConnectionChange > | Delegate for when a client connection changes. | QuicEndpointManager.h |
| FOnDeserializeHeader | TBaseDelegate_OneParam< FMessageHeader, FQuicPayloadPtr > | Delegate for when a header needs to be deserialized. | QuicEndpointManager.h |
| FOnEndpointNodeDiscovered | TBaseDelegate_OneParam< void, const FGuid & > | Delegate for when a node was discovered. | QuicEndpointManager.h |
| FOnEndpointNodeLost | TBaseDelegate_OneParam< void, const FGuid & > | Delegate for when a node was lost. | QuicEndpointManager.h |
| FOnMessageDelivered | TBaseDelegate_OneParam< void, const uint32 > | Delegate for when a message has been delivered. | QuicEndpointManager.h |
| FOnMessageValidated | TBaseDelegate_OneParam< void, const FInboundMessage > | Delegate for when a message has been received and validated. | QuicEndpointManager.h |
| FOnSerializeHeader | TBaseDelegate_OneParam< FQuicPayloadPtr, FMessageHeader & > | Delegate for when a header needs to be serialized. | QuicEndpointManager.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ClientConnectionChangedDelegate | FOnClientConnectionChanged | Holds a delegate to be invoked when a client connection has changed. | QuicEndpointManager.h | |
| CurrentConfiguration | HQUIC | Holds the current QUIC API configuration handle. | QuicEndpointManager.h | |
| DeserializeHeaderDelegate | FOnDeserializeHeader | Holds the deserialize header delegate. | QuicEndpointManager.h | |
| DiscoveryTimeoutCS | FCriticalSection | Mutex protecting the discovery timeouts array. | QuicEndpointManager.h | |
| DiscoveryTimeouts | TArray< FDiscoveryTimeoutEntry > | Holds the connection timestamps for discovery timeout purposes. | QuicEndpointManager.h | |
| DiscoveryTimeoutTickHandle | FTSTicker::FDelegateHandle | Holds the handle for the discovery timeout tick. | QuicEndpointManager.h | |
| EndpointConfig | TSharedRef< FQuicEndpointConfig > | Holds the endpoint config. | QuicEndpointManager.h | |
| EndpointMode | EEndpointMode | Flag indicating the endpoint mode. | QuicEndpointManager.h | |
| EndpointNodeDiscoveredDelegate | FOnEndpointNodeDiscovered | Holds a delegate to be invoked when a node was discovered. | QuicEndpointManager.h | |
| EndpointNodeLostDelegate | FOnEndpointNodeLost | Holds a delegate to be invoked when a node was lost. | QuicEndpointManager.h | |
| Endpoints | TMap< FIPv4Endpoint, FQuicEndpointPtr > | Holds the collection of active QUIC endpoints. | QuicEndpointManager.h | |
| EndpointsCS | FCriticalSection | Mutex protecting access to the endpoints map. | QuicEndpointManager.h | |
| KnownNodes | TMap< FGuid, FQuicNodeInfo > | Holds the collection of known remote nodes. | QuicEndpointManager.h | |
| LocalNodeId | FGuid | Holds the local node identifier. | QuicEndpointManager.h | |
| MessageDeliveredDelegate | FOnMessageDelivered | Holds a delegate to be invoked when a message was delivered to all endpoints. | QuicEndpointManager.h | |
| MessageValidatedDelegate | FOnMessageValidated | Holds a delegate to be invoked when a message has been received and validated, ready to be serialized by the local endpoint. | QuicEndpointManager.h | |
| MsQuic | const QUIC_API_TABLE * | Holds the QUIC API table handle. | QuicEndpointManager.h | |
| NodesCS | FCriticalSection | Mutex protecting access to the nodes map. | QuicEndpointManager.h | |
| ReconnectAttempts | TMap< FIPv4Endpoint, uint32 > | Holds the collection of reconnect attempts. | QuicEndpointManager.h | |
| Registration | HQUIC | Holds the QUIC API registration handle. | QuicEndpointManager.h | |
| SerializeHeaderDelegate | FOnSerializeHeader | Holds the serialize header delegate. | QuicEndpointManager.h | |
| ServerEndpoint | FIPv4Endpoint | Holds the local server endpoint that the socket will be bound to. | QuicEndpointManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddClient
(
const FIPv4Endpoint& ClientEndpoint |
Add remote endpoint client. | QuicEndpointManager.h | |
void DisconnectEndpoint
(
const FIPv4Endpoint& Endpoint |
Disconnect an endpoint. | QuicEndpointManager.h | |
void DisconnectNode
(
const FGuid& NodeId |
Disconnect a node. | QuicEndpointManager.h | |
void EndpointNodeDiscovered
(
const FGuid NodeId, |
Register discovered endpoint node. | QuicEndpointManager.h | |
void EndpointNodeLost
(
const FGuid NodeId, |
De-register lost endpoint node. | QuicEndpointManager.h | |
void EnqueueOutboundMessages
(
FQuicPayloadPtr Data, |
Enqueues outbound messages on all recipient endpoints. | QuicEndpointManager.h | |
TArray< FIPv4Endpoint > GetKnownEndpoints() |
Get a list of the known endpoints. | QuicEndpointManager.h | |
| Get the NodeId of a known endpoint. | QuicEndpointManager.h | ||
| Get a list of known NodeIds. | QuicEndpointManager.h | ||
FMessageTransportStatistics GetStats
(
FGuid NodeId |
Get the network/transport statistics for a node. | QuicEndpointManager.h | |
void InitializeServer () |
Set endpoint manager to operate in server mode and initialize server. | QuicEndpointManager.h | |
bool IsEndpointAuthenticated
(
const FGuid& NodeId |
Check if a QuicServerHandler endpoint is authenticated.This is only used for QuicServers | QuicEndpointManager.h | |
bool IsEndpointKnown
(
const FIPv4Endpoint Endpoint |
Check if an endpoint is associated with a known node. | QuicEndpointManager.h | |
FOnClientConnectionChanged & OnClientConnectionChanged() |
QuicEndpointManager.h | ||
FOnDeserializeHeader & OnDeserializeHeader() |
QuicEndpointManager.h | ||
FOnEndpointNodeDiscovered & OnEndpointNodeDiscovered() |
QuicEndpointManager.h | ||
FOnEndpointNodeLost & OnEndpointNodeLost() |
QuicEndpointManager.h | ||
FOnMessageDelivered & OnMessageDelivered() |
QuicEndpointManager.h | ||
FOnMessageValidated & OnMessageValidated() |
QuicEndpointManager.h | ||
FOnSerializeHeader & OnSerializeHeader() |
QuicEndpointManager.h | ||
void ReconnectClient
(
const FIPv4Endpoint ClientEndpoint |
Reconnect remote endpoint client. | QuicEndpointManager.h | |
void RemoveClient
(
const FIPv4Endpoint& ClientEndpoint |
Remove remote endpoint client. | QuicEndpointManager.h | |
void SetEndpointAuthenticated
(
const FGuid& NodeId |
Set QuicServerHandler endpoint as authenticated.This is only used for QuicServers | QuicEndpointManager.h | |
void Shutdown() |
Shutdown endpoint manager and kill client/server threads. | QuicEndpointManager.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CheckDiscoveryTimeout () |
Regularly called to check if any of the endpoints have reached the discovery timeout. | QuicEndpointManager.h | |
void CheckLoseNode
(
const FIPv4Endpoint LostEndpoint |
Checks if the lost endpoint node is still registered and removes it. | QuicEndpointManager.h | |
FMessageHeader DeserializeHeader
(
const FQuicPayloadPtr HeaderData |
Forward for the deserialize header delegate. | QuicEndpointManager.h | |
void EndpointConnected
(
const FIPv4Endpoint& ConnectedEndpoint |
Adds a DiscoveryTimeout entry if discovery timeouts are enabled. | QuicEndpointManager.h | |
void EndpointDisconnected
(
const FIPv4Endpoint DisconnectedEndpoint, |
Removes a disconnected endpoint. | QuicEndpointManager.h | |
void EndpointStatisticsUpdated
(
const FMessageTransportStatistics TransportStats |
Updates a KnownNode with new endpoint transport statistics. | QuicEndpointManager.h | |
bool IsMessageValid
(
const FInboundMessage InboundMessage |
Checks if a message is valid. | QuicEndpointManager.h | |
void SendEndpointHello
(
const FInboundMessage& InboundMessage |
Instructs the appropriate endpoint or handler to send a hello message. | QuicEndpointManager.h | |
FQuicPayloadPtr SerializeHeader
(
FMessageHeader& MessageHeader |
Forward for the serialize header delegate. | QuicEndpointManager.h | |
void ValidateInboundMessage
(
const FInboundMessage InboundMessage |
Validates InboundMessage and passes it to MessageProcessor. | QuicEndpointManager.h |