Topic Path: Symbol Reference > Classes > TIdStack Class > TIdStack Methods > SendTo Method
TIdStack.SendTo Method

Sends data to a specific destination using the socket handle.

function SendTo(
    ASocket: TIdStackSocketHandle; 
    const ABuffer: TIdBytes; 
    const AOffset: Integer; 
    const AIP: string; 
    const APort: integer; 
    const AIPVersion: TIdIPVersion = ID_DEFAULT_IP_VERSION
): Integer; virtual; abstract;
Socket handle for the operation.
Values to be sent on the socket handle.
Offset into the buffer to locate values to send.
IP address for the remote destination.
Port number for the remote destination.
IP address family for the IP address. 

Integer - Number of bytes written to the socket handle.

SendTo is an abstract virtual Integer function that specifes the method used to access the SendTo() API for a protocol stack implementation. 

SendTo is used to write the outgoing data in ABuffer on the socket handle in ASocket. SendTo uses the IP address and port numer in AIP and APort as the destination for the transmission. 

SendTo is normally used on a datagram socket, but can also override the current remote network destination for a streaming socket. 

Use Send to transmit data using a specified socket after the connection to the remote system has been established.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.