RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWinSocketStream.WaitForData Method

Waits up to TimeOut milliseconds for the socket connection to be ready to transfer data.

Pascal
function WaitForData(Timeout: Longint): Boolean;
C++
__fastcall Boolean WaitForData(Longint Timeout);

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, Read or Write method calls may time out before any data is transferred. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!