FUdpSocketReceiver

Asynchronously receives data from an UDP socket.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FRunnable

FSingleThreadRunnable

FUdpSocketReceiver

References

Module

Networking

Header

/Engine/Source/Runtime/Networking/Public/Common/UdpSocketReceiver.h

Include

#include "Common/UdpSocketReceiver.h"

Syntax

class FUdpSocketReceiver :
    public FRunnable,
    private FSingleThreadRunnable

Remarks

Asynchronously receives data from an UDP socket.

Constructors

Name Description

Public function

FUdpSocketReceiver

(
    FSocket* InSocket,
    const FTimespan& InWaitTime,
    const TCHAR* InThreadName
)

Creates and initializes a new socket receiver.

Destructors

Name Description

Public function Virtual

~FUdpSocketReceiver()

Virtual destructor.

Functions

Name Description

Public function

FOnSocketDat...

 

OnDataReceived()

Returns a delegate that is executed when data has been received.

Public function

void

 

SetMaxReadBufferSize

(
    uint32 InMaxReadBufferSize
)

Set the maximum size allocated to read off of the socket.

Public function

void

 

Start()

Start the receiver thread.

Protected function

void

 

Update

(
    const FTimespan& SocketWaitTime
)

Update this socket receiver.

Overridden from FRunnable

Name Description

Public function Virtual

void

 

Exit()

Exits the runnable object.

Public function Virtual

FSingleThrea...

 

GetSingleThreadInterface()

Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled.

Public function Virtual

bool

 

Init()

Initializes the runnable object.

Public function Virtual

uint32

 

Run()

Runs the runnable object.

Public function Virtual

void

 

Stop()

Stops the runnable object.

This is called if a thread is requested to terminate early.

Overridden from FSingleThreadRunnable

Name Description

Protected function Virtual

void

 

Tick()

Tick function.