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

Class to multiplex several streams on a single TCP socket. 更多...

#include <MultichannelTcpSocket.h>

Public 成员函数

int32 BlockingReceive (uint8 *Data, int32 Count, uint32 Channel)
 Block until data is available to receive. 更多...
 
int32 DataAvailable (uint32 Channel)
 Non-blocking test of available data. 更多...
 
 FMultichannelTcpSocket (FSocket *InSocket, uint64 InBandwidthLatencyProduct)
 Creates and initializes a new instance. 更多...
 
int32 PollingReceive (uint8 *Data, int32 MaxCount, uint32 Channel)
 Non-blocking return of available data. 更多...
 
void Send (const uint8 *Data, int32 Count, uint32 Channel)
 Send data out a given channel, this does not block on bandwidth, and never fails. 更多...
 

详细描述

Class to multiplex several streams on a single TCP socket.

The primary feature here is to allow blocking reads to multiple channels simultaneously without interference. Generally one of these is created on both sides of the connection, immediately after the connection is established

构造及析构函数说明

◆ FMultichannelTcpSocket()

FMultichannelTcpSocket::FMultichannelTcpSocket ( FSocket *  InSocket,
uint64  InBandwidthLatencyProduct 
)
inline

Creates and initializes a new instance.

参数
InSocketThe underlying socket to use.
InBandwidthLatencyProductThe maximum amount of unacknowledged data to send.

成员函数说明

◆ BlockingReceive()

int32 FMultichannelTcpSocket::BlockingReceive ( uint8 *  Data,
int32  Count,
uint32  Channel 
)
inline

Block until data is available to receive.

Can be called from any thread, but not multiple threads for one channel at once.

参数
DataThe buffer to fill.
CountThe number of bytes to receive.
ChannelThe channel to receive on.

◆ DataAvailable()

int32 FMultichannelTcpSocket::DataAvailable ( uint32  Channel)
inline

Non-blocking test of available data.

Can be called from any thread, but realize that if this returns > 0, another thread could steal the data.

参数
ChannelThe channel to check.
返回
The number of bytes in the receive buffer.

◆ PollingReceive()

int32 FMultichannelTcpSocket::PollingReceive ( uint8 *  Data,
int32  MaxCount,
uint32  Channel 
)
inline

Non-blocking return of available data.

Can be called from any thread, but realize that multiple threads hammering a channel at once is unlikely to give useful results.

参数
DataThe buffer to hold the results, if any.
MaxCountthe number of bytes in the receive buffer.
ChannelThe channel to check.
返回
The number of bytes written into Data.

◆ Send()

void FMultichannelTcpSocket::Send ( const uint8 *  Data,
int32  Count,
uint32  Channel 
)
inline

Send data out a given channel, this does not block on bandwidth, and never fails.

Can be called from any thread, but if you are calling from multiple threads, make sure you are sending an atomic unit.

参数
DataThe buffer containing the data to send.
CountThe number of bytes to send.
ChannelThe channel to send on.

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