Navigation
API > API/Runtime > API/Runtime/Networking
Asynchronously receives data from an UDP socket.
| Name | FUdpSocketReceiver |
| Type | class |
| Header File | /Engine/Source/Runtime/Networking/Public/Common/UdpSocketReceiver.h |
| Include Path | #include "Common/UdpSocketReceiver.h" |
Syntax
class FUdpSocketReceiver :
public FRunnable ,
private FSingleThreadRunnable
Inheritance Hierarchy
- FRunnable → FUdpSocketReceiver
- FSingleThreadRunnable → FUdpSocketReceiver
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Creates and initializes a new socket receiver. | Common/UdpSocketReceiver.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FUdpSocketReceiver() |
Virtual destructor. | Common/UdpSocketReceiver.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bStopping | std::atomic< bool > | Flag indicating that the thread is stopping. | Common/UdpSocketReceiver.h | |
| DataReceivedDelegate | FOnSocketDataReceived | Holds the data received delegate. | Common/UdpSocketReceiver.h | |
| MaxReadBufferSize | uint32 | The maximum read buffer size used to read the socket. | Common/UdpSocketReceiver.h | |
| Socket | FSocket * | The network socket. | Common/UdpSocketReceiver.h | |
| SocketSubsystem | ISocketSubsystem * | Pointer to the socket sub-system. | Common/UdpSocketReceiver.h | |
| Thread | FRunnableThread * | The thread object. | Common/UdpSocketReceiver.h | |
| ThreadName | FString | The receiver thread's name. | Common/UdpSocketReceiver.h | |
| ThreadStackSize | uint32 | Thread stack size to use. | Common/UdpSocketReceiver.h | |
| WaitTime | FTimespan | The amount of time to wait for inbound packets. | Common/UdpSocketReceiver.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FOnSocketDataReceived & OnDataReceived () |
Returns a delegate that is executed when data has been received. | Common/UdpSocketReceiver.h | |
void SetMaxReadBufferSize
(
uint32 InMaxReadBufferSize |
Set the maximum size allocated to read off of the socket. | Common/UdpSocketReceiver.h | |
void SetThreadStackSize
(
uint32 InTheadStackSize |
Set the desired Thread Stack Size. Only read when Start() is called. | Common/UdpSocketReceiver.h | |
void Start() |
Start the receiver thread. | Common/UdpSocketReceiver.h |
Overridden from FRunnable
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Exit() |
Common/UdpSocketReceiver.h | ||
virtual FSingleThreadRunnable * GetSingleThreadInterface() |
Common/UdpSocketReceiver.h | ||
virtual bool Init() |
Common/UdpSocketReceiver.h | ||
virtual uint32 Run() |
Common/UdpSocketReceiver.h | ||
virtual void Stop() |
Common/UdpSocketReceiver.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Update
(
const FTimespan& SocketWaitTime |
Update this socket receiver. | Common/UdpSocketReceiver.h |
Overridden from FSingleThreadRunnable
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Tick() |
Common/UdpSocketReceiver.h |