tCurlBase
TCurlBase is the base class for both
tCurl and
tCurlMulti.
Its main purpose is to provide an
optional thread to perform transfers in the background to prevent GUI applications
from appearing "hung" during potentially blocking system calls such as DNS resolution and
connect() functions.
Note:
tCurlBase is intended as a base class only, there should be no need to create an instance of this class directly!
property Threaded: boolean; (default=False)
If set to TRUE, this will enable the background thread for this object.
Note that all other properties described below are meaningless if Threaded is set to FALSE.
|
property OnWait: TNotifyEvent;
If assigned, this event will be fired every WaitInterval milliseconds during the Perform
function of a tCurl or tCurlMulti instance.
The main purpose of this event is simply to allow your application to call its ProcessMessages function,
or whatever it needs to do to update its GUI, etc.
Note that at this point, any interaction between the GUI and the libcurl library is not guaranteed to be 100% thread-safe,
for this reason, you should try to do only a bare mininum of processing within your event handlers when threading is enabled.
|
property WaitInterval: LongInt; (default=1000 ms)
The amount of time, in milliseconds, between calls to the OnWait event or WaitCallback procedure.
|
property WaitCallback: tCurlWaitCallback;
Similar to the OnWait property, only this provides a c-style callback rather than a GUI event handler.
The prototype for this callback is:
type tCurlWaitCallback = procedure ( UserData:pointer ); cdecl;
Note that the OnWait and WaitCallback properties are mutually exclusive, that is, setting one will set the other back to NIL.
|
property WaitData: tCurlWaitCallback;
User-defined pointer to anything you like, this will be passed in as the UserData parameter to the WaitCallback procedure.
|