Navigation
API > API/Runtime > API/Runtime/Sockets > API/Runtime/Sockets/FSocket
Description
Reads a chunk of data from a connected socket
A return value of 'true' does not necessarily mean that data was returned. Callers must check the 'BytesRead' parameter for the actual amount of data returned. A value of zero indicates that there was no data available for reading.
| Name | Recv |
| Type | function |
| Header File | /Engine/Source/Runtime/Sockets/Public/Sockets.h |
| Include Path | #include "Sockets.h" |
| Source | /Engine/Source/Runtime/Sockets/Private/Sockets.cpp |
virtual bool Recv
(
uint8 * Data,
int32 BufferSize,
int32 & BytesRead,
ESocketReceiveFlags::Type Flags
)
true on success, false in case of a closed socket or an unrecoverable error.
Parameters
| Name | Remarks |
|---|---|
| Data | The buffer to read into |
| BufferSize | The max size of the buffer |
| BytesRead | Will indicate how many bytes were read from the socket |
| Flags | the receive flags |