System.Net.Socket.TSocket.BeginReceiveFrom

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function BeginReceiveFrom(const AsyncCallbackEvent: TAsyncCallbackEvent; Count: Integer; Flags: TSocketFlags = []): IAsyncResult; overload;
function BeginReceiveFrom(const AsyncCallbackEvent: TAsyncCallbackEvent; Flags: TSocketFlags = []): IAsyncResult; overload; inline;
function BeginReceiveFrom(const AsyncCallback: TAsyncCallback; Count: Integer; Flags: TSocketFlags = []): IAsyncResult; overload;
function BeginReceiveFrom(const AsyncCallback: TAsyncCallback; Flags: TSocketFlags = []): IAsyncResult; overload; inline;
function BeginReceiveFrom(Count: Integer; Flags: TSocketFlags = []): IAsyncResult; overload; inline;
function BeginReceiveFrom(Flags: TSocketFlags = []): IAsyncResult; overload; inline;

C++

System::Types::_di_IAsyncResult __fastcall BeginReceiveFrom(const System::Classes::TAsyncProcedureEvent AsyncCallbackEvent, int Count, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginReceiveFrom(const System::Classes::TAsyncProcedureEvent AsyncCallbackEvent, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginReceiveFrom(const System::Classes::_di_TAsyncCallback AsyncCallback, int Count, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginReceiveFrom(const System::Classes::_di_TAsyncCallback AsyncCallback, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginReceiveFrom(int Count, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginReceiveFrom(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 data from a remote socket asynchronously.

In order to use BeginReceiveFrom, the type of your socket must be either TCP or UDP.

When you call BeginReceiveFrom it immediately returns an instance of a class that implements the IAsyncResult interface.

You may pass BeginReceiveFrom the following parameters:

  • AsyncCallbackEvent, an event handler of type TAsyncCallbackEvent that is called once the data has been received.
  • AsyncCallback, a method of type TAsyncCallback that is called once the data has been received.
  • Count is the maximum length of the requested data that ReceiveFrom returns.
  • Flags is a set of flags that influence the behavior of ReceiveFrom. For more information, see the documentation of the recv function in the MSDN.

Once your callback event handler or method is called, pass the returned instance of a class that implements the IAsyncResult interface to EndReceiveStringFrom or EndReceiveBytesFrom, in order to accept the incoming connection.

See Also