System.Net.Socket.TSocket.BeginSendTo

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

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

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

You may pass BeginSendTo the following parameters:

  • A string (S) or an array of bytes (B) to send.
  • 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: A number of bytes to skip at the beginning of the data to send (only if you send an array of bytes).
  • Count: The maximum length of the data to send (only if you send an array of bytes).
  • 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.

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

See Also