RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomWinSocket.SendText Method

Writes the string S to the socket connection.

Pascal
function SendText(const S: string): Integer;
C++
__fastcall int SendText(const AnsiString S);

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!