Abstract interface for handling BUrlRequest events.
More...
Inherited by BPrivate::Network::BUrlProtocolAsynchronousListener.
|
virtual void | BytesWritten (BUrlRequest *caller, size_t bytesWritten) |
| Called each time a block of data is written. More...
|
|
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 | 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) |
| 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.
◆ BytesWritten()
void BUrlProtocolListener::BytesWritten |
( |
BUrlRequest * |
caller, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Called each time a block of data is written.
This callback is called whenever a block of data is written to the BDataIO associated with the request. If no BDataIO is associated, the callback will not be invoked.
Frequency: Zero or more
- Parameters
-
caller | The BUrlRequest that invoked this callback. |
size | Size of the written data block. |
◆ 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
-
◆ 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 might still be invoked even when no BDataIO is associated with the request, as data can still be downloaded and discarded so that the request can be completed and the socket can be reused.
Frequency: Zero 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 written to the output BDataIO 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 | ) |
|
|
virtual |
Called when all of the server response metadata (such as headers) have been read and parsed.
Frequency: Once
- Parameters
-
◆ 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
-
◆ 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. |