Unreal Engine Plugin
Websocket Server
How to use Websocket server class
References
#include "websocket/wsserver.h"
How to use
Blueprint: search by GetInternetProtocolSubsystem
and call CreateWebsocketServer
function
C++: Use the code bellow
#include "websocket/wsserver.h"
UWSServer* net = NewObject<UWSServer>();
Variables
Backlog
- Set/Get the maximum number of simultaneous client connections the server will accept in queue.
Backlog
Functions
Is Open
- Return true if socket is open.
𝑓
Is Open
Return Value
Local Endpoint
- Get the local endpoint of the socket. Use this function only after open connection.
𝑓
Local Endpoint
Return Value
Clients
- Gets a constant reference to the set of clients connected to the server.
𝑓
Clients
Return Value
Get Error Code
- Return a struct of the latest error code returned by asio.
𝑓
Get Error Code
Return Value
Open
- Opens the TCP server and starts listening for incoming connections.
- It returns false if socket is already open or if asio return any error code during the bind.
𝑓
Open
Target is WSServer
Target
Bind Opts
Return Value
Close
- Close the underlying socket and stop listening for data on it. 'on_close' event will be triggered.
𝑓
Close
Target is WSServer
Target
Events
On Listening
- This event will be triggered when socket start to listening.
Bind Event to On Listening
Target
Event
On Listening
Custom Event
On Client Accepted
- This event will be triggered when new client connect.
Bind Event to On Client Accepted
Target
Event
On Client Accepted
Custom Event
Client
On Close
- Event triggered when socket is closed.
Bind Event to On Close
Target
Event
On Close
Custom Event
On Error
- Event triggered if any error occur during async process.