UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IWebSocket.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4#include "CoreMinimal.h"
5
7{
8public:
9
10 virtual ~IWebSocket()
11 { }
12
17 virtual void Connect() = 0;
18
24 virtual void Close(int32 Code = 1000, const FString& Reason = FString()) = 0;
25
29 virtual bool IsConnected() = 0;
30
35 virtual void Send(const FString& Data) = 0;
36
43 virtual void Send(const void* Data, SIZE_T Size, bool bIsBinary = false) = 0;
44
51
58
65
70 DECLARE_EVENT_ThreeParams(IWebSocket, FWebSocketClosedEvent, int32 /* StatusCode */, const FString& /* Reason */, bool /* bWasClean */);
72
78 DECLARE_EVENT_OneParam(IWebSocket, FWebSocketMessageEvent, const FString& /* MessageString */);
80
85 DECLARE_EVENT_ThreeParams(IWebSocket, FWebSocketBinaryMessageEvent, const void* /* Data */, SIZE_T /* Size */, bool /* bIsLastFragment */);
87
94 DECLARE_EVENT_ThreeParams(IWebSocket, FWebSocketRawMessageEvent, const void* /* Data */, SIZE_T /* Size */, SIZE_T /* BytesRemaining */);
96
101 DECLARE_EVENT_OneParam(IWebSocket, FWebSocketMessageSentEvent, const FString& /* MessageString */);
103};
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32 Size
Definition VulkanMemory.cpp:4034
Definition IWebSocket.h:7
DECLARE_EVENT_OneParam(IWebSocket, FWebSocketConnectionErrorEvent, const FString &)
virtual ~IWebSocket()
Definition IWebSocket.h:10
virtual FWebSocketRawMessageEvent & OnRawMessage()=0
virtual void Send(const FString &Data)=0
virtual FWebSocketConnectionErrorEvent & OnConnectionError()=0
DECLARE_EVENT(IWebSocket, FWebSocketConnectedEvent)
virtual FWebSocketClosedEvent & OnClosed()=0
DECLARE_EVENT_ThreeParams(IWebSocket, FWebSocketClosedEvent, int32, const FString &, bool)
virtual void Connect()=0
DECLARE_EVENT_ThreeParams(IWebSocket, FWebSocketBinaryMessageEvent, const void *, SIZE_T, bool)
virtual FWebSocketBinaryMessageEvent & OnBinaryMessage()=0
virtual FWebSocketConnectedEvent & OnConnected()=0
virtual void SetTextMessageMemoryLimit(uint64 TextMessageMemoryLimit)=0
virtual bool IsConnected()=0
virtual void Close(int32 Code=1000, const FString &Reason=FString())=0
DECLARE_EVENT_OneParam(IWebSocket, FWebSocketMessageSentEvent, const FString &)
virtual void Send(const void *Data, SIZE_T Size, bool bIsBinary=false)=0
DECLARE_EVENT_ThreeParams(IWebSocket, FWebSocketRawMessageEvent, const void *, SIZE_T, SIZE_T)
DECLARE_EVENT_OneParam(IWebSocket, FWebSocketMessageEvent, const FString &)
virtual FWebSocketMessageSentEvent & OnMessageSent()=0
virtual FWebSocketMessageEvent & OnMessage()=0