System.Net.Socket.TSocketStream.Read
Delphi
function Read(var Buffer; Count: LongInt): LongInt; overload; override;
C++
virtual System::LongInt __fastcall Read(void *Buffer, System::LongInt Count)/* overload */;
inline System::LongInt __fastcall Read(System::Sysutils::TBytes Buffer, System::LongInt Offset, System::LongInt Count){ return System::Classes::TStream::Read(Buffer, Offset, Count); }
inline System::LongInt __fastcall Read(System::Sysutils::TBytes &Buffer, System::LongInt Count){ return System::Classes::TStream::Read(Buffer, Count); }
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.Net.Socket.pas System.Net.Socket.hpp |
System.Net.Socket | TSocketStream |
Description
Obtains data sent from the connected endpoint of the socket that yous specified when you created your socket stream.
Read accepts the following parameters:
Bufis a pointer to the buffer to receive the incoming data.Countis the length (in bytes) of the buffer pointed byBuf, which is also the maximum length of the requested data that Read returns.
Exceptions
A call to Read can raise any of the following exceptions:
| Exception | Exception.Message | Scenarios |
|---|---|---|
|
Network socket error: <error message> (<error code>), on API 'ioctlsocket' |
| |
|
Network socket error: <error message> (<error code>), on API 'recv' |
|