HTTP module

ProgressSignal

HTTP progress signal for upload and download progress notifications.

#include <icy/http/connection.h>

class ProgressSignal

Defined in src/http/include/icy/http/connection.h:223

Emits a double in the range [0, 100] as data is transferred. Set total to the expected byte count before calling update().

Public Attributes

ReturnNameDescription
void *senderOptional context pointer identifying the sender.
uint64_tcurrentBytes transferred so far.
uint64_ttotalTotal expected bytes (from Content-Length).

sender

void * sender

Defined in src/http/include/icy/http/connection.h:226

Optional context pointer identifying the sender.


current

uint64_t current

Defined in src/http/include/icy/http/connection.h:227

Bytes transferred so far.


total

uint64_t total

Defined in src/http/include/icy/http/connection.h:228

Total expected bytes (from Content-Length).

Public Methods

ReturnNameDescription
ProgressSignal inline
doubleprogress const inlineReturns the current transfer progress as a percentage (0-100).
voidupdate inlineAdvances the progress counter by nread bytes and emits the updated percentage.

ProgressSignal

inline

inline ProgressSignal()

Defined in src/http/include/icy/http/connection.h:230


progress

const inline

inline double progress() const

Defined in src/http/include/icy/http/connection.h:238

Returns the current transfer progress as a percentage (0-100).


update

inline

inline void update(int nread)

Defined in src/http/include/icy/http/connection.h:243

Advances the progress counter by nread bytes and emits the updated percentage.

Parameters

ParameterTypeDescription
nreadintNumber of bytes just transferred.

Exceptions

ExceptionDescription
std::runtime_errorif current would exceed total.