System.Net.Socket.TSocket.BeginSend

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function BeginSend(const S: string; const AsyncCallbackEvent: TAsyncCallbackEvent; Flags: TSocketFlags = []): IAsyncResult; overload;
function BeginSend(const B: TBytes; const AsyncCallbackEvent: TAsyncCallbackEvent; Offset: Integer = 0; Count: Integer = -1; Flags: TSocketFlags = []): IAsyncResult; overload;
function BeginSend(const S: string; const AsyncCallback: TAsyncCallback; Flags: TSocketFlags = []): IAsyncResult; overload;
function BeginSend(const B: TBytes; const AsyncCallback: TAsyncCallback; Offset: Integer = 0; Count: Integer = -1; Flags: TSocketFlags = []): IAsyncResult; overload;
function BeginSend(const S: string; Flags: TSocketFlags = []): IAsyncResult; overload; inline;
function BeginSend(const B: TBytes; Offset: Integer = 0; Count: Integer = -1; Flags: TSocketFlags = []): IAsyncResult; overload; inline;

C++

System::Types::_di_IAsyncResult __fastcall BeginSend(const System::UnicodeString S, const System::Classes::TAsyncProcedureEvent AsyncCallbackEvent, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginSend(const System::DynamicArray<System::Byte> B, const System::Classes::TAsyncProcedureEvent AsyncCallbackEvent, int Offset = 0x0, int Count = 0xffffffff, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginSend(const System::UnicodeString S, const System::Classes::_di_TAsyncCallback AsyncCallback, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginSend(const System::DynamicArray<System::Byte> B, const System::Classes::_di_TAsyncCallback AsyncCallback, int Offset = 0x0, int Count = 0xffffffff, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginSend(const System::UnicodeString S, TSocketFlags Flags = TSocketFlags() )/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginSend(const System::DynamicArray<System::Byte> B, int Offset = 0x0, int Count = 0xffffffff, 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

Sends the specified data to the connected endpoint asynchronously.

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

You may pass BeginSend the following parameters:

  • AsyncCallbackEvent, an event handler of type TAsyncCallbackEvent that is called once the specified data is sent.
  • AsyncCallback, a method of type TAsyncCallback that is called once the specified data is sent.
  • Offset is a number of bytes to skip at the beginning of the data to send.
  • Count is the maximum length of the data to send.
  • Flags is a set of flags that influence the behavior of Send. For more information, see the documentation of the send function in the MSDN.
  • A string (S) or an array of bytes (B) to send.

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

See Also