RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TBaseSocket.WaitForData Method

Waits for the socket connection to be ready to transfer data.

Pascal
function WaitForData(TimeOut: Integer = 0): Boolean;
C++
__fastcall Boolean WaitForData(int TimeOut = 0);

Call WaitForData to ensure that the socket connection is ready to read or write information. WaitForData returns true if the socket connection is ready. WaitForData returns false if the socket connection is not ready after TimeOut milliseconds elapse. 

Call WaitForData before reading or writing information over the socket connection. Otherwise, ReceiveBuf, Receiveln, SendBuf, and Sendln method calls may time out before any data is transferred. 

 

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