Topic Path: Symbol Reference > Classes > TIdStackDotNet Class > TIdStackDotNet Methods > SendTo Method
ContentsIndexHome
PreviousUpNext
TIdStackDotNet.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; override;
Parameters 
Description 
ASocket 
Socket handle for the operation.
 
ABuffer 
Values to be sent on the socket handle.
 
AOffset 
Offset into the buffer to locate values to send.
 
AIP 
IP address for the remote destination.
 
APort 
Port number for the remote destination.
 
AIPVersion 
IP address family for the IP address. 

Integer - Number of bytes written to the socket handle.

SendTo is an overridden Integer function that implements the method used to access the SendTo() API for the 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. 

Exceptions occuring in the method are re-raised using either the EIdSocketError or EIdWrapperException exception types.

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