UWebSocketNetDriver

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

WebSocketNetworking

Header

/Engine/Plugins/Experimental/WebSocketNetworking/Source/WebSocketNetworking/Public/WebSocketNetDriver.h

Include

#include "WebSocketNetDriver.h"

Syntax

[UCLASS](Programming/UnrealArchitecture/Reference/Classes#classdeclaration)(Transient, Config=Engine)
class UWebSocketNetDriver : public UNetDriver

Variables

Name Description

Public variable UProperty Config

int32

 

WebSocketPort

WebSocket server port

Public variable

IWebSocketServe...

 

WebSocketServer

IWebSocketServer

Constructors

Name Description

Public function

UWebSocketNetDriver

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

UWebSocketCo...

 

GetServerConnection()

Public function

bool

 

HandleSocketsCommand

(
    const TCHAR* Cmd,
    FOutputDevice& Ar,
    UWorld* InWorld
)

Exec command handlers

Public function

void

 

OnWebSocketClientConnected

Callback Function for New Connection from a client is accepted by this server

Public function

void

 

OnWebSocketServerConnected()

Callback Function for when this client Connects to the server

Overridden from UNetDriver

Name Description

Public function Virtual

ISocketSubsy...

 

GetSocketSubsystem()

Stub implementation because for websockets we don't use any underlying socket sub system.

Public function Virtual

bool

 

InitBase

(
    bool bInitAsClient,
    FNetworkNotify* InNotify,
    const FURL& URL,
    bool bReuseAddressAndPort,
    FString& Error
)

Common initialization between server and client connection setup

Public function Virtual

bool

 

InitConnect

(
    FNetworkNotify* InNotify,
    const FURL& ConnectURL,
    FString& Error
)

Initialize the net driver in client mode

Public function Virtual

bool

 

InitListen

(
    FNetworkNotify* InNotify,
    FURL& ListenURL,
    bool bReuseAddressAndPort,
    FString& Error
)

Initialize the network driver in server mode (listener)

Public function Virtual Const

bool

 

IsAvailable()

Returns true if this net driver is valid for the current configuration.

Public function Virtual

bool

 

IsNetResourceValid()

Public function Virtual

void

 

LowLevelDestroy()

Close socket and Free the memory the OS allocated for this socket

Public function Virtual

FString

 

LowLevelGetNetworkNumber()

Public function Virtual

void

 

LowLevelSend

(
    TSharedPtr< const FInternetAddr > A...,
    void* Data,
    int32 CountBits,
    FOutPacketTraits& Traits
)

Sends a 'connectionless' (not associated with a UNetConection) packet, to the specified address.

Public function Virtual

void

 

TickDispatch

(
    float DeltaTime
)

Handle time update: read and process packets

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

(
    UWorld* InWorld,
    const TCHAR* Cmd,
    FOutputDevice& Ar
)

Handle exec commands

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss