Represents a connection to a SignalR server. More...
#include <Connection.h>
Public Member Functions | |
FConnection (const FString &InHost, const TMap< FString, FString > &InHeaders) | |
Creates a new connection to a SignalR server. | |
virtual | ~FConnection () |
Destructor for the connection with the SignalR server. | |
FConnection (const FConnection &)=delete | |
FConnection & | operator= (const FConnection &)=delete |
FConnection (FConnection &&)=delete | |
FConnection & | operator= (FConnection &&)=delete |
void | Connect () |
Initiates the connection process by starting the negotiation with the server. | |
bool | IsConnected () const |
Checks if the connection is currently established. | |
void | Send (const FString &Data) |
Sends data over the connection. | |
void | Close (int32 Code=1000, const FString &Reason=FString()) |
Closes the connection. | |
DECLARE_EVENT (FConnection, FConnectionFailedEvent) | |
FConnectionFailedEvent & | OnConnectionFailed () |
Gets the event that is triggered when the connection fails to establish. | |
IWebSocket::FWebSocketConnectedEvent & | OnConnected () |
Gets the event that is triggered when the connection is established. | |
IWebSocket::FWebSocketConnectionErrorEvent & | OnConnectionError () |
Gets the event that is triggered when a connection error occurs. | |
IWebSocket::FWebSocketClosedEvent & | OnClosed () |
Gets the event that is triggered when the connection is closed. | |
IWebSocket::FWebSocketMessageEvent & | OnMessage () |
Gets the event that is triggered when a message is received. | |
Represents a connection to a SignalR server.
Handles the low-level WebSocket connection, including negotiation, message passing, and connection lifecycle management. Thread-safe.
FConnection::FConnection | ( | const FString & | InHost, |
const TMap< FString, FString > & | InHeaders ) |
|
virtual |
Destructor for the connection with the SignalR server.
Triggers the Close function if the connection is still alive at this point.
|
delete |
|
delete |
void FConnection::Close | ( | int32 | Code = 1000, |
const FString & | Reason = FString() ) |
Closes the connection.
Code | The status code for closing the connection. Default is 1000. |
Reason | The reason for closing the connection. Default is empty. |
void FConnection::Connect | ( | ) |
Initiates the connection process by starting the negotiation with the server.
FConnection::DECLARE_EVENT | ( | FConnection | , |
FConnectionFailedEvent | ) |
bool FConnection::IsConnected | ( | ) | const |
Checks if the connection is currently established.
IWebSocket::FWebSocketClosedEvent & FConnection::OnClosed | ( | ) |
Gets the event that is triggered when the connection is closed.
IWebSocket::FWebSocketConnectedEvent & FConnection::OnConnected | ( | ) |
Gets the event that is triggered when the connection is established.
IWebSocket::FWebSocketConnectionErrorEvent & FConnection::OnConnectionError | ( | ) |
Gets the event that is triggered when a connection error occurs.
FConnection::FConnectionFailedEvent & FConnection::OnConnectionFailed | ( | ) |
Gets the event that is triggered when the connection fails to establish.
IWebSocket::FWebSocketMessageEvent & FConnection::OnMessage | ( | ) |
Gets the event that is triggered when a message is received.
|
delete |
|
delete |
void FConnection::Send | ( | const FString & | Data | ) |
Sends data over the connection.
Data | The data to send. |