#include <IWebSocket.h>
|
| virtual | ~IWebSocket () |
| |
| virtual void | Connect ()=0 |
| |
| virtual void | Close (int32 Code=1000, const FString &Reason=FString())=0 |
| |
| virtual bool | IsConnected ()=0 |
| |
| virtual void | Send (const FString &Data)=0 |
| |
| virtual void | Send (const void *Data, SIZE_T Size, bool bIsBinary=false)=0 |
| |
| virtual void | SetTextMessageMemoryLimit (uint64 TextMessageMemoryLimit)=0 |
| |
| | DECLARE_EVENT (IWebSocket, FWebSocketConnectedEvent) |
| |
| virtual FWebSocketConnectedEvent & | OnConnected ()=0 |
| |
| | DECLARE_EVENT_OneParam (IWebSocket, FWebSocketConnectionErrorEvent, const FString &) |
| |
| virtual FWebSocketConnectionErrorEvent & | OnConnectionError ()=0 |
| |
| | DECLARE_EVENT_ThreeParams (IWebSocket, FWebSocketClosedEvent, int32, const FString &, bool) |
| |
| virtual FWebSocketClosedEvent & | OnClosed ()=0 |
| |
| | DECLARE_EVENT_OneParam (IWebSocket, FWebSocketMessageEvent, const FString &) |
| |
| virtual FWebSocketMessageEvent & | OnMessage ()=0 |
| |
| | DECLARE_EVENT_ThreeParams (IWebSocket, FWebSocketBinaryMessageEvent, const void *, SIZE_T, bool) |
| |
| virtual FWebSocketBinaryMessageEvent & | OnBinaryMessage ()=0 |
| |
| | DECLARE_EVENT_ThreeParams (IWebSocket, FWebSocketRawMessageEvent, const void *, SIZE_T, SIZE_T) |
| |
| virtual FWebSocketRawMessageEvent & | OnRawMessage ()=0 |
| |
| | DECLARE_EVENT_OneParam (IWebSocket, FWebSocketMessageSentEvent, const FString &) |
| |
| virtual FWebSocketMessageSentEvent & | OnMessageSent ()=0 |
| |
◆ ~IWebSocket()
| virtual IWebSocket::~IWebSocket |
( |
| ) |
|
|
inlinevirtual |
◆ Close()
| virtual void IWebSocket::Close |
( |
int32 |
Code = 1000, |
|
|
const FString & |
Reason = FString() |
|
) |
| |
|
pure virtual |
Close the current connection.
- Parameters
-
| Code | Numeric status code explaining why the connection is being closed. Default is 1000. See WebSockets spec for valid codes. |
| Reason | Human readable string explaining why the connection is closing. |
◆ Connect()
Initiate a client connection to the server. Use this after setting up event handlers or to reconnect after connection errors.
◆ DECLARE_EVENT()
Delegate called when a web socket connection has been established successfully.
◆ DECLARE_EVENT_OneParam() [1/3]
Delegate called when a web socket connection could not be established.
◆ DECLARE_EVENT_OneParam() [2/3]
Delegate called when a web socket text message has been received. Assumes the payload is encoded as UTF8. For binary data, bind to OnRawMessage instead.
◆ DECLARE_EVENT_OneParam() [3/3]
Delegate called when a web socket text message has been sent. Assume UTF-8 encoding.
◆ DECLARE_EVENT_ThreeParams() [1/3]
Delegate called when web socket binary data has been received. bIsLastFragment will be true if it is the last fragment of the current packet.
◆ DECLARE_EVENT_ThreeParams() [2/3]
Delegate called when a web socket connection has been closed.
◆ DECLARE_EVENT_ThreeParams() [3/3]
Delegate called when any web socket data has been received. May be called multiple times for a message if the message was split into multiple frames. This is called for every web socket fragment. BytesRemaining is the number of bytes left in the current fragment.
◆ IsConnected()
Inquire if this web socket instance is connected to a server.
◆ OnBinaryMessage()
◆ OnClosed()
◆ OnConnected()
◆ OnConnectionError()
◆ OnMessage()
◆ OnMessageSent()
◆ OnRawMessage()
◆ Send() [1/2]
Transmit data over the connection.
- Parameters
-
| Data | data to be sent as a UTF-8 encoded string. |
◆ Send() [2/2]
Transmit data over the connection.
- Parameters
-
| Data | raw binary data to be sent. |
| Size | number of bytes to send. |
| bIsBinary | set to true to send binary frame to the peer instead of text. |
◆ SetTextMessageMemoryLimit()
Optionally change memory limit for receiving UTF-8 text on this socket. Default from config TextMessageMemoryLimit under [WebSockets] or 1MB.
- Parameters
-
| TextMessageMemoryLimit | new buffer size upper limit in bytes. |
The documentation for this class was generated from the following file: