Internet Direct (Indy)
Home
PreviousUpNext
TIdIOHandler.OnWork Event

Event handler for buffered read and write operations.

Pascal
property OnWork;

OnWork is a public TWorkEvent property in TIdIOHandler that is the event handler signalled when a read or write method is called for the IOHandler. OnWork is generally used to control the update of progress indicators or GUI components. 

The work mode indicates the operation performed and the notification sent to OnWork, 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. 
AWorkCount 
Indicates the number of bytes affected by the operation sent to OnWork. 

 

The OnWork event handler is triggered when a notification message is received as data is removed from the internal buffer for the IOHandler, and when data is written to the destination for the IOHandler connection. 

Applications must assign a procedure to the OnWork event handler to allow responding to the event notification. 

Use OnWorkBegin to respond to the initiation of a read or write request. 

Use OnWorkEnd to respond to the completion of a read or write request.

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.