System.Win.ScktComp.TWinSocketStream.WaitForData

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function WaitForData(Timeout: Longint): Boolean;

C++

bool __fastcall WaitForData(int Timeout);

Properties

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

Description

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

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.

See Also