class
FWebSocket
- Module
- GameNet
- Header
#include "GameNet/WebSocket.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
FWebSocket() | FWebSocket | |
~FWebSocket() | ~FWebSocket | |
FWebSocket(const FWebSocket&) = delete | FWebSocket |
Public functions
| Returns | Name | Description |
|---|---|---|
FWebSocket& | operator= | |
bool | Connect | Blocking HTTP upgrade to ws:// or wss://. |
void | Poll | Non-blocking pump: drains everything the socket has, reassembles fragmented frames, answers PINGs, queues complete messages. |
bool | Receive | Pop one complete message. |
bool | SendText | |
bool | SendBinary | |
bool | SendPing | |
void | Close | Sends a CLOSE frame when still connected, then tears down. |
EWebSocketState | GetState | |
const std::string& | GetError |
Function details
FWebSocket
C++
FWebSocket()~FWebSocket
C++
~FWebSocket()FWebSocket
C++
FWebSocket(const FWebSocket&) = deleteoperator=
C++
FWebSocket& operator=(const FWebSocket&) = deleteConnect
C++
bool Connect(const std::string& url, const std::vector<std::string>& headers = {}, long timeoutSeconds = 15)Blocking HTTP upgrade to ws:// or wss://. Extra headers are raw "Name: value" lines (e.g. an auth token when the gateway wants it in a header rather than the query string).
Poll
C++
void Poll()Non-blocking pump: drains everything the socket has, reassembles fragmented frames, answers PINGs, queues complete messages. Call once per tick. State moves to Closed/Failed here, never mid-Receive.
Receive
C++
bool Receive(FWebSocketMessage& out)Pop one complete message. Returns false when the queue is empty.
SendText
C++
bool SendText(const std::string& payload)SendBinary
C++
bool SendBinary(const void* data, size_t size)SendPing
C++
bool SendPing(const std::string& payload = "")Close
C++
void Close()Sends a CLOSE frame when still connected, then tears down.
GetState
C++
EWebSocketState GetState() constGetError
C++
const std::string& GetError() constGenerated from GameNet/WebSocket.h via gamenet.json · Oct 26, 2026Version 1.0.0