UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMultichannelTcpSocket Class Reference

#include <MultichannelTcpSocket.h>

Public Member Functions

 FMultichannelTcpSocket (FSocket *InSocket, uint64 InBandwidthLatencyProduct)
 
int32 BlockingReceive (uint8 *Data, int32 Count, uint32 Channel)
 
int32 DataAvailable (uint32 Channel)
 
int32 PollingReceive (uint8 *Data, int32 MaxCount, uint32 Channel)
 
void Send (const uint8 *Data, int32 Count, uint32 Channel)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ FMultichannelTcpSocket()

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

Creates and initializes a new instance.

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

Member Function Documentation

◆ 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.

Parameters
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.

Parameters
ChannelThe channel to check.
Returns
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.

Parameters
DataThe buffer to hold the results, if any.
MaxCountthe number of bytes in the receive buffer.
ChannelThe channel to check.
Returns
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.

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

The documentation for this class was generated from the following file: