System.Net.Socket.TSocket.ReceiveStringFrom
Delphi
function ReceiveStringFrom(Flags: TSocketFlags = []): string; overload; inline;
function ReceiveStringFrom(out Endpoint: TNetEndpoint; Flags: TSocketFlags = []): string; overload;
C++
System::UnicodeString __fastcall ReceiveStringFrom(TSocketFlags Flags = TSocketFlags() )/* overload */;
System::UnicodeString __fastcall ReceiveStringFrom(/* out */ TNetEndpoint &Endpoint, TSocketFlags Flags = TSocketFlags() )/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Net.Socket.pas System.Net.Socket.hpp |
System.Net.Socket | TSocket |
Description
Receives a string from either the specified endpoint or the configured endpoint.
In order to use ReceiveStringFrom, the type of your socket must be either TCP
or UDP
.
ReceiveStringFrom blocks the caller until it returns the requested string.
You may pass ReceiveStringFrom a Flags
parameter, which is a set of flags that influence the behavior of ReceiveStringFrom. For more information, see the documentation of the recvfrom function in the MSDN.
Use the Endpoint
parameter to specify a source end point. If you do not specify an Endpoint
parameter, your socket receives the string from the endpoint specified in the value of its Addr property.
Exceptions
A call to ReceiveStringFrom 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 'recvfrom' |
|