Interface for a SignalR hub connection that enables real-time communication with a SignalR server. More...
#include <IHubConnection.h>
Public Member Functions | |
virtual void | Start ()=0 |
Starts the connection to the SignalR hub. | |
virtual void | Stop ()=0 |
Stops the connection to the SignalR hub. | |
DECLARE_EVENT (IHubConnection, FOnHubConnectedEvent) | |
Delegate called when a connection has been established successfully. | |
virtual FOnHubConnectedEvent & | OnConnected ()=0 |
Gets the event that is triggered when the connection is successfully established. | |
DECLARE_EVENT_OneParam (IHubConnection, FOnHubConnectionErrorEvent, const FString &) | |
Delegate called when a connection could not be established. | |
virtual FOnHubConnectionErrorEvent & | OnConnectionError ()=0 |
Gets the event that is triggered when a connection error occurs. | |
DECLARE_EVENT (IHubConnection, FHubConnectionClosedEvent) | |
Delegate called when a web socket connection has been closed. | |
virtual FHubConnectionClosedEvent & | OnClosed ()=0 |
Gets the event that is triggered when the connection is closed. | |
DECLARE_DELEGATE_OneParam (FOnMethodInvocation, const TArray< FSignalRValue > &) | |
virtual FOnMethodInvocation & | On (const FString &EventName)=0 |
Registers a callback for a specific hub method invocation from the server. | |
DECLARE_DELEGATE_OneParam (FOnMethodCompletion, const FSignalRInvokeResult &) | |
virtual FOnMethodCompletion & | Invoke (const FString &EventName, const TArray< FSignalRValue > &InArguments=TArray< FSignalRValue >())=0 |
Invokes a hub method on the server with the specified arguments and waits for a response. | |
template<typename... ArgTypes> | |
FORCEINLINE FOnMethodCompletion & | Invoke (const FString &EventName, ArgTypes... Arguments) |
Templated version of Invoke that converts arguments to FSignalRValue automatically. | |
virtual void | Send (const FString &EventName, const TArray< FSignalRValue > &InArguments=TArray< FSignalRValue >())=0 |
Sends a message to a hub method on the server without waiting for a response. | |
template<typename... ArgTypes> | |
FORCEINLINE void | Send (const FString &EventName, ArgTypes... Arguments) |
Templated version of Send that converts arguments to FSignalRValue automatically. | |
Protected Member Functions | |
virtual | ~IHubConnection () |
Interface for a SignalR hub connection that enables real-time communication with a SignalR server.
Provides methods for starting/stopping connections, registering event handlers, and invoking server methods.
|
protectedvirtual |
IHubConnection::DECLARE_DELEGATE_OneParam | ( | FOnMethodCompletion | , |
const FSignalRInvokeResult & | ) |
IHubConnection::DECLARE_DELEGATE_OneParam | ( | FOnMethodInvocation | , |
const TArray< FSignalRValue > & | ) |
IHubConnection::DECLARE_EVENT | ( | IHubConnection | , |
FHubConnectionClosedEvent | ) |
Delegate called when a web socket connection has been closed.
IHubConnection::DECLARE_EVENT | ( | IHubConnection | , |
FOnHubConnectedEvent | ) |
Delegate called when a connection has been established successfully.
IHubConnection::DECLARE_EVENT_OneParam | ( | IHubConnection | , |
FOnHubConnectionErrorEvent | , | ||
const FString & | ) |
Delegate called when a connection could not be established.
|
inline |
Templated version of Invoke that converts arguments to FSignalRValue automatically.
ArgTypes | Variadic template parameters representing the argument types. Must be types that can be converted to FSignalRValue. |
EventName | The name of the hub method to invoke. |
Arguments | Variable number of arguments to pass to the hub method. |
|
pure virtual |
Invokes a hub method on the server with the specified arguments and waits for a response.
EventName | The name of the hub method to invoke. |
InArguments | Array of arguments to pass to the hub method. |
Implemented in FHubConnection.
|
pure virtual |
Registers a callback for a specific hub method invocation from the server.
EventName | The name of the hub method to listen for. |
Implemented in FHubConnection.
|
pure virtual |
Gets the event that is triggered when the connection is closed.
Implemented in FHubConnection.
|
pure virtual |
Gets the event that is triggered when the connection is successfully established.
Implemented in FHubConnection.
|
pure virtual |
Gets the event that is triggered when a connection error occurs.
Implemented in FHubConnection.
|
inline |
Templated version of Send that converts arguments to FSignalRValue automatically.
EventName | The name of the hub method to send a message to. |
Arguments | Variable number of arguments to pass to the hub method. |
|
pure virtual |
Sends a message to a hub method on the server without waiting for a response.
EventName | The name of the hub method to send a message to. |
InArguments | Array of arguments to pass to the hub method. |
Implemented in FHubConnection.
|
pure virtual |
Starts the connection to the SignalR hub.
Implemented in FHubConnection.
|
pure virtual |
Stops the connection to the SignalR hub.
Implemented in FHubConnection.