Navigation
API > API/Runtime > API/Runtime/Networking
Asynchronously sends data to an UDP socket.
| Name | FUdpSocketSender |
| Type | class |
| Header File | /Engine/Source/Runtime/Networking/Public/Common/UdpSocketSender.h |
| Include Path | #include "Common/UdpSocketSender.h" |
Syntax
class FUdpSocketSender :
public FRunnable ,
private FSingleThreadRunnable
Inheritance Hierarchy
- FRunnable → FUdpSocketSender
- FSingleThreadRunnable → FUdpSocketSender
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FUdpSocketSender
(
FSocket* InSocket, |
Creates and initializes a new socket sender. | Common/UdpSocketSender.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FUdpSocketSender() |
Virtual destructor. | Common/UdpSocketSender.h |
Structs
| Name | Remarks |
|---|---|
| FPacket | Structure for outbound packets. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| SendQueue | TQueue< FPacket, EQueueMode::Mpsc > | The send queue. | Common/UdpSocketSender.h | |
| SendRate | uint32 | The send rate. | Common/UdpSocketSender.h | |
| Socket | FSocket * | The network socket. | Common/UdpSocketSender.h | |
| Stopping | bool | Flag indicating that the thread is stopping. | Common/UdpSocketSender.h | |
| Thread | FRunnableThread * | The thread object. | Common/UdpSocketSender.h | |
| Throughput | uint32 | The current throughput. | Common/UdpSocketSender.h | |
| WaitTime | FTimespan | The amount of time to wait for inbound packets. | Common/UdpSocketSender.h | |
| WorkEvent | FEvent * | An event signaling that inbound messages need to be processed. | Common/UdpSocketSender.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint32 GetSendRate() |
Gets the maximum send rate (in bytes per second). | Common/UdpSocketSender.h | |
uint32 GetThroughput() |
Gets the current throughput (in bytes per second). | Common/UdpSocketSender.h | |
bool Send
(
const TSharedRef< TArray< uint8 >, ESPMode::ThreadSafe >& Data, |
Sends data to the specified recipient. | Common/UdpSocketSender.h | |
void SetSendRate
(
uint32 Rate |
Sets the send rate (in bytes per second). | Common/UdpSocketSender.h | |
void SetWaitTime
(
const FTimespan& Timespan |
Sets the maximum time span to wait for work items. | Common/UdpSocketSender.h |
Overridden from FRunnable
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Exit() |
Common/UdpSocketSender.h | ||
virtual FSingleThreadRunnable * GetSingleThreadInterface() |
Common/UdpSocketSender.h | ||
virtual bool Init() |
Common/UdpSocketSender.h | ||
virtual uint32 Run() |
Common/UdpSocketSender.h | ||
virtual void Stop() |
Common/UdpSocketSender.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool Update
(
const FTimespan& SocketWaitTime |
Update this socket sender. | Common/UdpSocketSender.h |
Overridden from FSingleThreadRunnable
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Tick() |
Common/UdpSocketSender.h |