System.Win.ScktComp.TCustomWinSocket.SendText

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SendText(const S: AnsiString): Integer;

C++

int __fastcall SendText(const System::AnsiString S);

Properties

Type Visibility Source Unit Parent
function public
System.Win.ScktComp.pas
System.Win.ScktComp.hpp
System.Win.ScktComp TCustomWinSocket

Description

Writes the string S to the socket connection.

Use SendText to write a string to the socket connection. The writing may occur in the OnSocketEvent event handler of a Windows socket object or in the OnWrite or OnClientWrite event handler of a socket component. Alternately, SendText may write from a socket that is expected to write to the connection without a notification to signal the connection's readiness to read. If an error occurs while writing to the connection, SendText terminates the connection and raises an ESocketError exception.

SendText returns the number of bytes sent. Note that this may be less than the length of the string S if the socket is nonblocking.

See Also