UIpNetDriver

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

OnlineSubsystemUtils

Header

/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Classes/IpNetDriver.h

Include

#include "IpNetDriver.h"

Syntax

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

Variables

Name Description

Public variable UProperty Config

uint32: 1

 

AllowPlayerPortUnreach

Does the game allow clients to remain after receiving ICMP port unreachable errors (handles flakey connections)

Public variable UProperty Config

uint32: 1

 

LogPortUnreach

Should port unreachable messages be logged

Public variable UProperty Config

uint32

 

MaxPortCountToTry

Number of ports which will be tried if current one is not available for binding (i.e. if told to bind to port N, will try from N to N+MaxPortCountToTry inclusive)

Public variable

float

 

PauseReceiveEnd

If pausing socket receives, the time at which this should end

Constructors

Name Description

Public function

UIpNetDriver

(
    const FObjectInitializer& ObjectIn...
)

Base constructor

UIpNetDriver

Functions

Name Description

Protected function Virtual

FUniqueSocke...

 

CreateAndBindSocket

(
    TSharedRef< FInternetAddr > BindAdd...,
    int32 Port,
    bool bReuseAddressAndPort,
    int32 DesiredRecvSize,
    int32 DesiredSendSize,
    FString& Error
)

Creates, initializes and binds a socket using the given bind address information.

Protected function Virtual

FUniqueSocke...

 

CreateSocketForProtocol

(
    const FName& ProtocolType
)

Creates a socket set up for communication using the given protocol.

Public function Virtual

int

 

GetClientPort()

Returns the port number to use when a client is creating a socket.

Public function Const

float

 

GetResolutionTimeoutValue()

Public function

UIpConnectio...

 

GetServerConnection()

Public function Virtual

FSocket *...

 

GetSocket()

Returns the current FSocket to be used with this NetDriver.

Public function

bool

 

HandlePauseReceiveCommand

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

Public function

bool

 

HandleSocketsCommand

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

Exec command handlers

Public function

void

 

SetSocketAndLocalAddress

(
    FSocket* NewSocket
)

Set the current NetDriver's socket to the given socket and takes ownership of it (the driver will handle destroying it).

Public function

void

 

SetSocketAndLocalAddress

(
    const TSharedPtr< FSocket >& Share...
)

Set the current NetDriver's socket to the given socket.

Public function

void

 

TestSuddenPortChange

(
    uint32 NumConnections
)

Tests a scenario where a connected client suddenly starts sending traffic on a different port (can happen due to a rare router bug.

Overridden from UNetDriver

Name Description

Public function Virtual

ISocketSubsy...

 

GetSocketSubsystem()

Get the socket subsytem appropriate for this net driver

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

Typedefs

Name

Description

FOnNetworkProcessingCausingSlowFrame

Callback for platform handling when networking is taking a long time in a single frame (by default over 1 second).

Constants

Name

Description

OnNetworkProcessingCausingSlowFrame

For backwards compatibility with the engine stateless connect code

Deprecated Variables

Name Description

Public variable

FSocket *

 

Socket

Socket access is now controlled through the getter/setter combo: GetSocket and SetSocketAndLocalAddress

Deprecated Functions

Name Description

Public function Virtual

FSocket *...

 

CreateSocket()

Socket creation is now restricted to subclasses and done through CreateSocketForProtocol or CreateAndBindSocket

Public function

UNetConnecti...

 

ProcessConnectionlessPacket

(
    const TSharedRef< FInternetAddr >&...,
    uint8* Data,
    int32& CountBytesRef
)

ProcessConnectionlessPacket has a new API, and will become private soon.

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