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

Asynchronously receives data from an UDP socket. 更多...

#include <UdpSocketReceiver.h>

+ 类 FUdpSocketReceiver 继承关系图:

Public 成员函数

virtual void Exit () override
 Exits the runnable object. 更多...
 
 FUdpSocketReceiver (FSocket *InSocket, const FTimespan &InWaitTime, const TCHAR *InThreadName)
 Creates and initializes a new socket receiver. 更多...
 
virtual FSingleThreadRunnable * GetSingleThreadInterface () override
 Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. 更多...
 
virtual bool Init () override
 Initializes the runnable object. 更多...
 
FOnSocketDataReceived & OnDataReceived ()
 Returns a delegate that is executed when data has been received. 更多...
 
virtual uint32 Run () override
 Runs the runnable object. 更多...
 
void SetMaxReadBufferSize (uint32 InMaxReadBufferSize)
 Set the maximum size allocated to read off of the socket.
 
void Start ()
 Start the receiver thread.
 
virtual void Stop () override
 Stops the runnable object. 更多...
 
virtual ~FUdpSocketReceiver ()
 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 成员函数

void Update (const FTimespan &SocketWaitTime)
 Update this socket receiver.
 

详细描述

Asynchronously receives data from an UDP socket.

构造及析构函数说明

◆ FUdpSocketReceiver()

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

Creates and initializes a new socket receiver.

参数
InSocketThe UDP socket to receive data from.
InWaitTimeThe amount of time to wait for the socket to be readable.
InThreadNameThe receiver thread name (for debugging).

成员函数说明

◆ Exit()

virtual void FUdpSocketReceiver::Exit ( )
inlineoverridevirtual

Exits the runnable object.

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

参见
Init, Run, Stop

重载 FRunnable .

◆ GetSingleThreadInterface()

virtual FSingleThreadRunnable * FUdpSocketReceiver::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 .

◆ Init()

virtual bool FUdpSocketReceiver::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 .

◆ OnDataReceived()

FOnSocketDataReceived & FUdpSocketReceiver::OnDataReceived ( )
inline

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

This delegate must be bound before the receiver thread is started with the Start() method. It cannot be unbound while the thread is running.

返回
The delegate.

◆ Run()

virtual uint32 FUdpSocketReceiver::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.

◆ Stop()

virtual void FUdpSocketReceiver::Stop ( )
inlineoverridevirtual

Stops the runnable object.

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

参见
Init, Run, Exit

重载 FRunnable .


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