FSteamSocketsSubsystem

Steam Sockets specific socket subsystem implementation.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

SteamSockets

Header

/Engine/Plugins/Runtime/Steam/SteamSockets/Source/SteamSockets/Public/SteamSocketsSubsystem.h

Include

#include "SteamSocketsSubsystem.h"

Syntax

class FSteamSocketsSubsystem :
    public ISocketSubsystem,
    public FTickerObjectBase,
    public FSelfRegisteringExec

Remarks

Steam Sockets specific socket subsystem implementation. This class can only be used with the SteamSocketsNetDriver and the SteamSocketsNetConnection classes. This subsystem does not support mixing any other NetDriver/NetConnection format. Doing so will cause this protocol to not function.

Variables

Name Description

Protected variable

bool

 

bShouldTestPeek

Flag for testing peek messaging (only usable in non-shipping builds)

Protected variable

bool

 

bUseRelays

Determines if the connections are going to be using the relay network

Protected variable

int32

 

LastSocketError

Last error set by the socket subsystem or one of its sockets

Protected variable

TArray< FSteamP...

 

PendingListenerArray

Array of listeners we need to activate.

Protected variable

SocketHandleInf...

 

SocketInformationMap

Protected variable

TSharedPtr< cla...

 

SteamAPIClientHandle

Steam Client API Handle

Protected variable

TSharedPtr< cla...

 

SteamAPIServerHandle

Steam Server API Handle

Protected variable

TUniquePtr< cla...

 

SteamEventManager

Event manager for Steam tasks

Protected variable

FDelegateHandle

 

SteamServerLoginDelegateHandle

Delegate handle for handling when a dedicated server logs into the Steam platform.

Constructors

Name Description

Public function

FSteamSocketsSubsystem()

Functions

Name Description

Protected function

void

 

AddDelayedListener

(
    FSteamSocket* ListenSocket,
    USteamSocketsNetDriver* NewNet...
)

Delayed listen socket helpers.

Protected function

void

 

AddSocket

(
    const FInternetAddr& ForAddr,
    FSteamSocket* NewSocket,
    FSteamSocket* ParentSocket
)

Steam socket bookkeeping modifiers.

Protected function

void

 

CleanSocketInformation

(
    bool bForceClean
)

Protected function Static

FSteamSocket...

 

Create()

Singleton helpers.

Protected function Static

void

 

Destroy()

Protected function Const

void

 

DumpSocketInformationMap()

Protected function

TSharedPtr< ...

 

GetIdentityAddress()

Returns this machine's identity in the form of a FInternetAddrSteamSockets.

Protected function

FSteamSocket...

 

GetSocketInfo

(
    const FInternetAddr& ForAddress
)

Steam socket queriers.

Protected function

FSteamSocket...

 

GetSocketInfo

(
    SteamSocketHandles InternalSocketHa...
)

Steam socket queriers.

Public function Static

ISteamNetwor...

 

GetSteamSocketsInterface()

Protected function Const

bool

 

IsLoggedInToSteam()

Returns if our account is currently logged into the Steam network.

Public function Const

bool

 

IsSteamInitialized()

Basic function to determine if Steam has been initialized properly.

Public function Const

bool

 

IsUsingRelayNetwork()

Returns if the application is using the SteamSocket relays

Protected function

void

 

LinkNetDriver

(
    FSocket* Socket,
    USteamSocketsNetDriver* NewNet...
)

Protected function

void

 

OnServerLoginComplete

(
    bool bWasSuccessful
)

Protected function

void

 

QueueRemoval

(
    SteamSocketHandles SocketHandle
)

Protected function

void

 

RemoveSocketsForListener

(
    FSteamSocket* ListenerSocket
)

Protected function

void

 

SteamSocketEventHandler

(
    SteamNetConnectionStatusChangedCall...
)

SteamAPI internals handler.

Overridden from ISocketSubsystem

Name Description

Public function Virtual

TSharedRef< ...

 

CreateInternetAddr

(
    const FName ProtocolType
)

Create a FInternetAddr of the desired protocol

Public function Virtual

TSharedRef< ...

 

CreateInternetAddr()

Create a proper FInternetAddr representation

Public function Virtual

FSocket *...

 

CreateSocket

(
    const FName& SocketType,
    const FString& SocketDescription,
    const FName& ProtocolName
)

Creates a socket using the given protocol name.

Public function Virtual

void

 

DestroySocket

(
    FSocket* Socket
)

Cleans up a socket class

Public function Virtual

TSharedPtr< ...

 

GetAddressFromString

(
    const FString& InAddress
)

Serializes a string that only contains an address.

Public function Virtual

FAddressInfo...

 

GetAddressInfo

(
    const TCHAR* HostName,
    const TCHAR* ServiceName,
    EAddressInfoFlags QueryFlags,
    const FName ProtocolTypeName,
    ESocketType SocketType
)

Gets the address information of the given hostname and outputs it into an array of resolvable addresses.

Public function Virtual

bool

 

GetHostName

(
    FString& HostName
)

Determines the name of the local machine

Public function Virtual

ESocketError...

 

GetLastErrorCode()

Returns the last error that has happened

Public function Virtual

bool

 

GetLocalAdapterAddresses

(
    TArray< TSharedPtr< FInternetAddr >...
)

Gets the list of addresses associated with the adapters on the local computer.

Public function Virtual

TArray< TSha...

 

GetLocalBindAddresses()

Get bindable addresses that this machine can use as reported by GetAddressInfo with the BindableAddress flag.

Public function Virtual Const

const TCHAR ...

 

GetSocketAPIName()

Get the name of the socket subsystem

Public function Virtual

bool

 

HasNetworkDevice()

Public function Virtual

bool

 

Init

(
    FString& Error
)

Does per platform initialization of the sockets library

Public function Virtual Const

bool

 

IsSocketWaitSupported()

Returns true if FSocket::Wait is supported by this socket subsystem.

Public function Virtual

bool

 

RequiresChatDataBeSeparate()

Some platforms require chat data (voice, text, etc.) to be placed into packets in a special way.

Public function Virtual

bool

 

RequiresEncryptedPackets()

Some platforms require packets be encrypted.

Public function Virtual

void

 

Shutdown()

Performs platform specific socket clean up

Public function Virtual

ESocketError...

 

TranslateErrorCode

(
    int32 Code
)

Translates the platform error code to a ESocketErrors enum

Overridden from FTickerObjectBase

Name Description

Public function Virtual

bool

 

Tick

(
    float DeltaTime
)

Pure virtual that must be overloaded by the inheriting class.

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

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

Exec handler

Classes

Name

Description

Protected struct

FSteamPendingSocketInformation

Structure for handling sockets that cannot be established due to platform login (for listener sockets)

Protected struct

FSteamSocketInformation

A struct for holding steam socket information and managing bookkeeping on the protocol.

Typedefs

Name

Description

SocketHandleInfoMap

Active connection bookkeeping

Constants

Name

Description

SocketSingleton

Single instantiation of this subsystem

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