engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 所有成员列表
FUdpSocketSender类 参考

Asynchronously sends data to an UDP socket. 更多...

#include <UdpSocketSender.h>

+ 类 FUdpSocketSender 继承关系图:

Public 成员函数

virtual void Exit () override
 Exits the runnable object. 更多...
 
 FUdpSocketSender (FSocket *InSocket, const TCHAR *ThreadDescription)
 Creates and initializes a new socket sender. 更多...
 
uint32 GetSendRate () const
 Gets the maximum send rate (in bytes per second). 更多...
 
virtual FSingleThreadRunnable * GetSingleThreadInterface () override
 Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. 更多...
 
uint32 GetThroughput () const
 Gets the current throughput (in bytes per second). 更多...
 
virtual bool Init () override
 Initializes the runnable object. 更多...
 
virtual uint32 Run () override
 Runs the runnable object. 更多...
 
bool Send (const TSharedRef< TArray< uint8 >, ESPMode::ThreadSafe > &Data, const FIPv4Endpoint &Recipient)
 Sends data to the specified recipient. 更多...
 
void SetSendRate (uint32 Rate)
 Sets the send rate (in bytes per second). 更多...
 
void SetWaitTime (const FTimespan &Timespan)
 Sets the maximum time span to wait for work items. 更多...
 
virtual void Stop () override
 Stops the runnable object. 更多...
 
virtual ~FUdpSocketSender ()
 Virtual destructor.
 
- Public 成员函数 继承自 FRunnable
virtual void Exit ()
 Exits the runnable object. 更多...
 
virtual class FSingleThreadRunnable * GetSingleThreadInterface ()
 Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. 更多...
 
virtual bool Init ()
 Initializes the runnable object. 更多...
 
virtual uint32 Run ()=0
 Runs the runnable object. 更多...
 
virtual void Stop ()
 Stops the runnable object. 更多...
 
virtual ~FRunnable ()
 Virtual destructor
 

Protected 成员函数

bool Update (const FTimespan &SocketWaitTime)
 Update this socket sender. 更多...
 

详细描述

Asynchronously sends data to an UDP socket.

待办事项:
networking: gmp: implement rate limits

构造及析构函数说明

◆ FUdpSocketSender()

FUdpSocketSender::FUdpSocketSender ( FSocket *  InSocket,
const TCHAR *  ThreadDescription 
)
inline

Creates and initializes a new socket sender.

参数
InSocketThe UDP socket to use for sending data.
ThreadDescriptionThe thread description text (for debugging).

成员函数说明

◆ Exit()

virtual void FUdpSocketSender::Exit ( )
inlineoverridevirtual

Exits the runnable object.

Called in the context of the aggregating thread to perform any cleanup.

参见
Init, Run, Stop

重载 FRunnable .

◆ GetSendRate()

uint32 FUdpSocketSender::GetSendRate ( ) const
inline

Gets the maximum send rate (in bytes per second).

返回
Current send rate.

◆ GetSingleThreadInterface()

virtual FSingleThreadRunnable * FUdpSocketSender::GetSingleThreadInterface ( )
inlineoverridevirtual

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

If the interface is not implemented, this runnable will not be ticked when FPlatformProcess::SupportsMultithreading() is false.

返回
Pointer to the single thread interface or nullptr if not implemented.

重载 FRunnable .

◆ GetThroughput()

uint32 FUdpSocketSender::GetThroughput ( ) const
inline

Gets the current throughput (in bytes per second).

返回
Current throughput.

◆ Init()

virtual bool FUdpSocketSender::Init ( )
inlineoverridevirtual

Initializes the runnable object.

This method is called in the context of the thread object that aggregates this, not the thread that passes this runnable to a new thread.

返回
True if initialization was successful, false otherwise
参见
Run, Stop, Exit

重载 FRunnable .

◆ Run()

virtual uint32 FUdpSocketSender::Run ( )
inlineoverridevirtual

Runs the runnable object.

This is where all per object thread work is done. This is only called if the initialization was successful.

返回
The exit code of the runnable object
参见
Init, Stop, Exit

实现了 FRunnable.

◆ Send()

bool FUdpSocketSender::Send ( const TSharedRef< TArray< uint8 >, ESPMode::ThreadSafe > &  Data,
const FIPv4Endpoint &  Recipient 
)
inline

Sends data to the specified recipient.

参数
DataThe data to send.
RecipientThe recipient.
返回
true if the data will be sent, false otherwise.

◆ SetSendRate()

void FUdpSocketSender::SetSendRate ( uint32  Rate)
inline

Sets the send rate (in bytes per second).

参数
RateThe new send rate (0 = unlimited).
参见
SetWaitTime

◆ SetWaitTime()

void FUdpSocketSender::SetWaitTime ( const FTimespan &  Timespan)
inline

Sets the maximum time span to wait for work items.

参数
TimespanThe wait time.
参见
SetSendRate

◆ Stop()

virtual void FUdpSocketSender::Stop ( )
inlineoverridevirtual

Stops the runnable object.

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

参见
Init, Run, Exit

重载 FRunnable .

◆ Update()

bool FUdpSocketSender::Update ( const FTimespan &  SocketWaitTime)
inlineprotected

Update this socket sender.

参数
Timeto wait for the socket.
返回
true on success, false otherwise.

该类的文档由以下文件生成: