The OpenD Programming Language

HTTP.onProgress

Register an event handler that gets called to inform of upload/download progress.

More...
struct HTTP
version(StdDdoc)
@property
void
onProgress
(
int delegate
(
size_t dlTotal
,
size_t dlNow
,
size_t ulTotal
,
size_t ulNow
)
callback
)

Detailed Description

Callback parameters

$(CALLBACK_PARAMS)

Callback returns

Return 0 to signal success, return non-zero to abort transfer.

Examples

import std.net.curl, std.stdio;
auto client = HTTP("dlang.org");
client.onProgress = delegate int(size_t dl, size_t dln, size_t ul, size_t uln)
{
    writeln("Progress: downloaded ", dln, " of ", dl);
    writeln("Progress: uploaded ", uln, " of ", ul);
    return 0;
};
client.perform();

Meta