![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#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) |
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
|
inline |
Creates and initializes a new instance.
| InSocket | The underlying socket to use. |
| InBandwidthLatencyProduct | The maximum amount of unacknowledged data to send. |
Block until data is available to receive.
Can be called from any thread, but not multiple threads for one channel at once.
| Data | The buffer to fill. |
| Count | The number of bytes to receive. |
| Channel | The channel to receive on. |
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.
| Channel | The channel to check. |
|
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.
| Data | The buffer to hold the results, if any. |
| MaxCount | the number of bytes in the receive buffer. |
| Channel | The channel to check. |
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.
| Data | The buffer containing the data to send. |
| Count | The number of bytes to send. |
| Channel | The channel to send on. |