Internet Direct (Indy)
Home
PreviousUpNext
TIdComponent.BeginWork Method

Triggers the OnBeginWork event.

Pascal
procedure BeginWork(
    AWorkMode: TWorkMode; 
    const ASize: Int64 = 0
); virtual;
Parameters 
Description 
AWorkMode 
Work mode for the peer connection.
 
ASize 
Number of bytes to be read or written. Default value is 0. 

BeginWork is a virtual procedure used to trigger the OnBeginWork event. BeginWork maintains the number of reads and writes pending. BeginWork also maintains the size of the initial read and/or write request when the Size is known at the beginning of the request. 

AWorkMode is a TWorkMode enumerated type, and can contain one of the following values: 

 

Value 
Meaning 
wmRead 
The component is reading data from the peer. 
wmWrite 
The component is sending data to the peer. 

 

ASize is the optional value indicating the number of bytes expected by to be received or sent by the connection. When ASize is omitted, the default value of 0 is assigned. 

Calls to the BeginWork procedure can be nested, but the OnBeginWork event handler will be invoked only for the initial call to BeginWork. 

Applications must assign a procedure to the OnBeginWork event handler in order to respond to the event notification. 

Use EndWork to close the work mode event for the current level. 

Use DoWork to signal when bytes for the current work level are handled. 

When WorkTarget is assigned, work mode events are signalled in the TIdComponent identified by WorkTarget instead of the current object instance.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.