Abstract interface for handling BUrlRequest events.
More...
Inherited by BPrivate::Network::BUrlProtocolAsynchronousListener.
|
virtual bool | CertificateVerificationFailed (BUrlRequest *caller, BCertificate &certificate, const char *message) |
| Called when cerificate verification failed. More...
|
|
virtual void | ConnectionOpened (BUrlRequest *caller) |
| Called when the socket is opened. More...
|
|
virtual void | DataReceived (BUrlRequest *caller, const char *data, off_t position, ssize_t size) |
| Called each time a block of data is received. More...
|
|
virtual void | DebugMessage (BUrlRequest *caller, BUrlProtocolDebugMessage type, const char *text) |
| Called each time a debug message is emitted. More...
|
|
virtual void | DownloadProgress (BUrlRequest *caller, off_t bytesReceived, off_t bytesTotal) |
| Called each time a block of data is downloaded. More...
|
|
virtual void | HeadersReceived (BUrlRequest *caller, const BUrlResult &result) |
| Called when all of the server response metadata (such as headers) have been read and parsed. More...
|
|
virtual void | HostnameResolved (BUrlRequest *caller, const char *ip) |
| Called when the final IP is discovered. More...
|
|
virtual void | RequestCompleted (BUrlRequest *caller, bool success) |
| Called once the request is complete. More...
|
|
virtual void | ResponseStarted (BUrlRequest *caller) |
| Called when the request has been emitted and the server begins to reply. More...
|
|
virtual void | UploadProgress (BUrlRequest *caller, off_t bytesSent, off_t bytesTotal) |
| Called each time a block of data is sent. More...
|
|
Abstract interface for handling BUrlRequest events.
BUrlProtocolListener is the base class for handling networking events from BUrlRequest.
◆ CertificateVerificationFailed()
bool BUrlProtocolListener::CertificateVerificationFailed |
( |
BUrlRequest * |
caller, |
|
|
BCertificate & |
certificate, |
|
|
const char * |
message |
|
) |
| |
|
virtual |
Called when cerificate verification failed.
Frequency: Once
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
certificate | The SSL certificate of which validation failed. |
message | The error message describing the issue. |
- Returns
true
to ignore and proceed with the request, false
to abort.
◆ ConnectionOpened()
void BUrlProtocolListener::ConnectionOpened |
( |
BUrlRequest * |
caller | ) |
|
|
virtual |
Called when the socket is opened.
Frequency: Once
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
◆ DataReceived()
void BUrlProtocolListener::DataReceived |
( |
BUrlRequest * |
caller, |
|
|
const char * |
data, |
|
|
off_t |
position, |
|
|
ssize_t |
size |
|
) |
| |
|
virtual |
Called each time a block of data is received.
Frequency: Zero or more
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
data | Pointer to the data block in memory. |
position | Offset of the data in the stream. |
size | Size of the data block. |
◆ DebugMessage()
Called each time a debug message is emitted.
Frequency: Zero or more
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
type | Type of the message. |
text | The message. |
◆ DownloadProgress()
void BUrlProtocolListener::DownloadProgress |
( |
BUrlRequest * |
caller, |
|
|
off_t |
bytesReceived, |
|
|
off_t |
bytesTotal |
|
) |
| |
|
virtual |
Called each time a block of data is downloaded.
This callback will usually be called after DataReceived().
Frequency: Once or more
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
bytesReceived | Number of data bytes received. This is the number of bytes received prior to any processing and can be smaller than the size of the data block sent to DataReceived() as the transport might be compressed. |
bytesTotal | Total number of data bytes expected. 0 will be passed if the total number of data bytes is not available. |
◆ HeadersReceived()
void BUrlProtocolListener::HeadersReceived |
( |
BUrlRequest * |
caller, |
|
|
const BUrlResult & |
result |
|
) |
| |
|
virtual |
Called when all of the server response metadata (such as headers) have been read and parsed.
Frequency: Once
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
result | The BUrlResult associated with the request. |
◆ HostnameResolved()
void BUrlProtocolListener::HostnameResolved |
( |
BUrlRequest * |
caller, |
|
|
const char * |
ip |
|
) |
| |
|
virtual |
Called when the final IP is discovered.
Frequency: Once
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
ip | String representing the IP address of the resource host. |
◆ RequestCompleted()
void BUrlProtocolListener::RequestCompleted |
( |
BUrlRequest * |
caller, |
|
|
bool |
success |
|
) |
| |
|
virtual |
Called once the request is complete.
Frequency: Once
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
success | Whether the request has been successfully completed. |
◆ ResponseStarted()
void BUrlProtocolListener::ResponseStarted |
( |
BUrlRequest * |
caller | ) |
|
|
virtual |
Called when the request has been emitted and the server begins to reply.
Typically this callback will be called when the HTTP status code is received.
Frequency: Once
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
◆ UploadProgress()
void BUrlProtocolListener::UploadProgress |
( |
BUrlRequest * |
caller, |
|
|
off_t |
bytesSent, |
|
|
off_t |
bytesTotal |
|
) |
| |
|
virtual |
Called each time a block of data is sent.
- Note
- Currently this callback is never called.
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
bytesSent | Number of data bytes sent. |
bytesTotal | Total number of data bytes left. |