Internet Direct (Indy) Version 9.0.1 Beta
TIdDataChannelThread
Implements a threaded data channel for an FTP client thread,

TIdDataChannelThread = class(TIdThread)
Description
TIdDataChannelThread is a TIdThread descendant that implements the data channel used when a threaded FTP client connection needs to read or write data using the FTP STOR, STOU, APPE, RETR, LIST, or NLST command verbs.

TIdDataChannelThread provides properties that represent the connection used for an acive or passive data channel for the FTP client, the control channel from the threaded client, and TIdRFCReply properties representing the success and error messages used when performing data transfer. TIdDataChannelThread provides methods that create the active or passive connection, initialize the data channel, or start the thread of execution.

TIdDataChannelThread can represent an active or a passive connection type on the data channel. When passive connections are used, the connection is constructed as a TIdSimpleServer object instance. When the TIdDataChannelThread thread is started, the data channel will be used to listen for a client connection.

When active connections are opened by the client thread, the connection is constructed using a TIdTCPClient object instance bound to the FTP data port 20. When the TIdDataChannelThread thread is started, the data channel will be connected.

During execution, the data channel thread uses the Data property to access the TStrings or TStream values used during the data transfer operation. After performing the transfer operation, the socket for the data channel in the thread is disconnected, and the Success or Error message is written using the control channel for the threaded client connection. The data channel thread is stopped after execution of the transfer operation.

TIdDataChannelThread is the thread type created for use in the TIdFTPServerThread.DataChannel property in a threaded client connection. The data channel thread exists for the lifetime of the threaded client connection. It is initalized and started prior to data transfer operations, and suspended when the data transfer operation is completed.