Protocol.onProgress

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

mixintemplate Protocol()
@property
void
onProgress
(
int delegate
(
size_t dlTotal
,
size_t dlNow
,
size_t ulTotal
,
size_t ulNow
)
callback
)

Return Value

Type: void

Return 0 from the callback 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