Navigation
API > API/Runtime > API/Runtime/Sockets
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
| Name | FMultichannelTcpSocket |
| Type | class |
| Header File | /Engine/Source/Runtime/Sockets/Public/MultichannelTcpSocket.h |
| Include Path | #include "MultichannelTcpSocket.h" |
Syntax
class FMultichannelTcpSocket
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMultichannelTcpSocket
(
FSocket* InSocket, |
Creates and initializes a new instance. | MultichannelTcpSocket.h |
Structs
| Name | Remarks |
|---|---|
| FReceiveBuffer | Helper struct for a receive buffer per channel |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BandwidthLatencyProduct | uint64 | Holds the maximum amount of unacknowledged data to send. | MultichannelTcpSocket.h | |
| ReceiveBuffers | TMap< uint32, FReceiveBuffer * > | Holds the buffers for incoming per-channel data. | MultichannelTcpSocket.h | |
| ReceiveBuffersCriticalSection | FCriticalSection | Holds a critical section to guard the receive buffers. | MultichannelTcpSocket.h | |
| Receiver | FMultichannelTcpReceiver | Holds the receiver thread. | MultichannelTcpSocket.h | |
| RemoteReceiverBytesReceived | int64 | Holds the total number of bytes received by the client (comes from an 'Ack' on the control channel). | MultichannelTcpSocket.h | |
| Sender | FMultichannelTcpSender | Holds the sender thread. | MultichannelTcpSocket.h | |
| Socket | FSocket * | Holds the socket used for actual transfers. | MultichannelTcpSocket.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 BlockingReceive
(
uint8* Data, |
Block until data is available to receive. | MultichannelTcpSocket.h | |
int32 DataAvailable
(
uint32 Channel |
Non-blocking test of available data. | MultichannelTcpSocket.h | |
int32 PollingReceive
(
uint8* Data, |
Non-blocking return of available data. | MultichannelTcpSocket.h | |
void Send
(
const uint8* Data, |
Send data out a given channel, this does not block on bandwidth, and never fails. | MultichannelTcpSocket.h |