UnrealVoxta 0.1.1
 
Loading...
Searching...
No Matches
FConnection Class Reference

Represents a connection to a SignalR server. More...

#include <Connection.h>

Inheritance diagram for FConnection:

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
 
FConnectionoperator= (const FConnection &)=delete
 
 FConnection (FConnection &&)=delete
 
FConnectionoperator= (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.
 

Detailed Description

Represents a connection to a SignalR server.

Handles the low-level WebSocket connection, including negotiation, message passing, and connection lifecycle management. Thread-safe.

Constructor & Destructor Documentation

◆ FConnection() [1/3]

FConnection::FConnection ( const FString & InHost,
const TMap< FString, FString > & InHeaders )

Creates a new connection to a SignalR server.

Parameters
InHostThe URL of the SignalR server.
InHeadersHTTP headers to include in requests to the server.

◆ ~FConnection()

FConnection::~FConnection ( )
virtual

Destructor for the connection with the SignalR server.

Triggers the Close function if the connection is still alive at this point.

◆ FConnection() [2/3]

FConnection::FConnection ( const FConnection & )
delete

◆ FConnection() [3/3]

FConnection::FConnection ( FConnection && )
delete

Member Function Documentation

◆ Close()

void FConnection::Close ( int32 Code = 1000,
const FString & Reason = FString() )

Closes the connection.

Parameters
CodeThe status code for closing the connection. Default is 1000.
ReasonThe reason for closing the connection. Default is empty.

◆ Connect()

void FConnection::Connect ( )

Initiates the connection process by starting the negotiation with the server.

◆ DECLARE_EVENT()

FConnection::DECLARE_EVENT ( FConnection ,
FConnectionFailedEvent  )

◆ IsConnected()

bool FConnection::IsConnected ( ) const

Checks if the connection is currently established.

Returns
True if the connection is established, false otherwise.

◆ OnClosed()

IWebSocket::FWebSocketClosedEvent & FConnection::OnClosed ( )

Gets the event that is triggered when the connection is closed.

Returns
Reference to the closed event.

◆ OnConnected()

IWebSocket::FWebSocketConnectedEvent & FConnection::OnConnected ( )

Gets the event that is triggered when the connection is established.

Returns
Reference to the connected event.

◆ OnConnectionError()

IWebSocket::FWebSocketConnectionErrorEvent & FConnection::OnConnectionError ( )

Gets the event that is triggered when a connection error occurs.

Returns
Reference to the connection error event.

◆ OnConnectionFailed()

FConnection::FConnectionFailedEvent & FConnection::OnConnectionFailed ( )

Gets the event that is triggered when the connection fails to establish.

Returns
Reference to the connection failed event.

◆ OnMessage()

IWebSocket::FWebSocketMessageEvent & FConnection::OnMessage ( )

Gets the event that is triggered when a message is received.

Returns
Reference to the message event.

◆ operator=() [1/2]

FConnection & FConnection::operator= ( const FConnection & )
delete

◆ operator=() [2/2]

FConnection & FConnection::operator= ( FConnection && )
delete

◆ Send()

void FConnection::Send ( const FString & Data)

Sends data over the connection.

Parameters
DataThe data to send.

The documentation for this class was generated from the following files: