CFx SDK Documentation 2024 SP0
|
#include <FxNANetworkReply.h>
Public Types | |
enum | NetworkError { NoError = 0 , ConnectionRefusedError = 1 , RemoteHostClosedError , HostNotFoundError , TimeoutError , OperationCanceledError , SslHandshakeFailedError , TemporaryNetworkFailureError , NetworkSessionFailedError , BackgroundRequestNotAllowedError , TooManyRedirectsError , InsecureRedirectError , UnknownNetworkError = 99 , ProxyConnectionRefusedError = 101 , ProxyConnectionClosedError , ProxyNotFoundError , ProxyTimeoutError , ProxyAuthenticationRequiredError , UnknownProxyError = 199 , ContentAccessDenied = 201 , ContentOperationNotPermittedError , ContentNotFoundError , AuthenticationRequiredError , ContentReSendError , ContentConflictError , ContentGoneError , UnknownContentError = 299 , ProtocolUnknownError = 301 , ProtocolInvalidOperationError , ProtocolFailure = 399 , InternalServerError = 401 , OperationNotImplementedError , ServiceUnavailableError , UnknownServerError = 499 } |
typedef CFxNAPair< CFxNAByteArray, CFxNAByteArray > | RawHeaderPair |
Additional Inherited Members | |
Protected Member Functions inherited from CFxUIObject | |
CFxUIObject * | sender () |
Protected Attributes inherited from CFxUIObject | |
CFxUIObjectImpl * | m_pImpl |
CFxUIObjectData * | m_pData |
Class CFxNANetworkReply class contains the data and headers for a request sent with CFxNANetworkAccessManager.
Definition at line 45 of file FxNANetworkReply.h.
Definition at line 241 of file FxNANetworkReply.h.
This enum type indicates all possible error conditions found during the processing of the request.
Enumerator | |
---|---|
NoError | no error condition. |
ConnectionRefusedError | the remote server refused the connection (the server is not accepting requests) |
RemoteHostClosedError | the remote server closed the connection prematurely, before the entire reply was received and processed |
HostNotFoundError | the remote host name was not found (invalid hostname) |
TimeoutError | the connection to the remote server timed out |
OperationCanceledError | the operation was canceled via calls to abort() or close() before it was finished. |
SslHandshakeFailedError | the SSL/TLS handshake failed and the encrypted channel could not be established. The sslErrors() signal should have been emitted. |
TemporaryNetworkFailureError | the connection was broken due to disconnection from the network, however the system has initiated roaming to another access point. |
NetworkSessionFailedError | the connection was broken due to disconnection from the network or failure to start the network. |
BackgroundRequestNotAllowedError | the background request is not currently allowed due to platform policy. |
TooManyRedirectsError | while following redirects, the maximum limit was reached. |
InsecureRedirectError | while following redirects, the network access API detected a redirect from a encrypted protocol (https) to an unencrypted one (http). |
UnknownNetworkError | an unknown network-related error was detected |
ProxyConnectionRefusedError | the connection to the proxy server was refused (the proxy server is not accepting requests) |
ProxyConnectionClosedError | the proxy server closed the connection prematurely, before the entire reply was received and processed |
ProxyNotFoundError | the proxy host name was not found (invalid proxy hostname) |
ProxyTimeoutError | the connection to the proxy timed out or the proxy did not reply in time to the request sent |
ProxyAuthenticationRequiredError | the proxy requires authentication in order to honour the request but did not accept any credentials offered (if any) |
UnknownProxyError | an unknown proxy-related error was detected |
ContentAccessDenied | the access to the remote content was denied (similar to HTTP error 403) |
ContentOperationNotPermittedError | the operation requested on the remote content is not permitted |
ContentNotFoundError | the remote content was not found at the server (similar to HTTP error 404) |
AuthenticationRequiredError | the remote server requires authentication to serve the content but the credentials provided were not accepted (if any) |
ContentReSendError | the request needed to be sent again, but this failed for example because the upload data could not be read a second time. |
ContentConflictError | the request could not be completed due to a conflict with the current state of the resource. |
ContentGoneError | the requested resource is no longer available at the server. |
UnknownContentError | an unknown error related to the remote content was detected |
ProtocolUnknownError | the Network Access API cannot honor the request because the protocol is not known |
ProtocolInvalidOperationError | the requested operation is invalid for this protocol |
ProtocolFailure | a breakdown in protocol was detected (parsing error, invalid or unexpected responses, etc.) |
InternalServerError | the server encountered an unexpected condition which prevented it from fulfilling the request. |
OperationNotImplementedError | the server does not support the functionality required to fulfill the request. |
ServiceUnavailableError | the server is unable to handle the request at this time. |
UnknownServerError | an unknown error related to the server response was detected |
Definition at line 51 of file FxNANetworkReply.h.
|
delete |
Constructor
Not able to create object with default constructor.
|
explicit |
Constructor
|
delete |
Constructor
CFxNANetworkReply::~CFxNANetworkReply | ( | ) |
Destructor
void CFxNANetworkReply::abort | ( | ) |
Aborts the operation immediately and close down any network connections still open.
Uploads still in progress are also aborted.
CFxNAVariant CFxNANetworkReply::attribute | ( | CFxNANetworkRequest::Attribute | code | ) | const |
Returns the attribute associated with the code code.
code | Input attribute define by Attribute enum |
long long CFxNANetworkReply::bytesAvailable | ( | ) | const |
Returns the number of bytes that are available for reading.
This function is commonly used with sequential devices to determine the number of bytes to allocate in a buffer before reading.
CFxUISignal< void(long long bytesReceived, long long bytesTotal)> & CFxNANetworkReply::downloadProgress | ( | ) |
Signal is emitted to indicate the progress of the download part of this network request, if there's any.
If there's no download associated with this request, this signal will be emitted once with 0 as the value of both bytesReceived and bytesTotal.
CFxUISignal< void(void)> & CFxNANetworkReply::encrypted | ( | ) |
Signal is emitted when an SSL/TLS session has successfully completed the initial handshake.
At this point, no user data has been transmitted
CFxUISignal< void(NetworkError)> & CFxNANetworkReply::error | ( | ) |
This signal is emitted when the reply detects an error in processing.
The finished() signal will probably follow, indicating that the connection is over.
NetworkError CFxNANetworkReply::error | ( | ) | const |
Returns the error that was found during the processing of this request. If no error was found, returns NoError.
CFxNAString CFxNANetworkReply::errorString | ( | ) | const |
Returns a human-readable description of the last device error that occurred.
CFxUISignal< void(void)> & CFxNANetworkReply::finished | ( | ) |
This signal is emitted when the reply has finished processing. After this signal is emitted, there will be no more updates to the reply's data or metadata.
Unless close() or abort() have been called, the reply will be still be opened for reading, so the data can be retrieved by calls to read() or readAll().
bool CFxNANetworkReply::hasRawHeader | ( | const CFxNAByteArray & | headerName | ) | const |
Returns true if the raw header of name headerName was sent by the remote server
headerName | Input |
CFxNAVariant CFxNANetworkReply::header | ( | CFxNANetworkRequest::KnownHeaders | header | ) | const |
Returns the value of the known header header, if that header was sent by the remote server
header | Input attribute define by KnownHeaders enum |
bool CFxNANetworkReply::isFinished | ( | ) | const |
Returns true when the reply has finished or was aborted.
bool CFxNANetworkReply::isRunning | ( | ) | const |
Returns true when the request is still processing and the reply has not finished or was aborted yet.
long long CFxNANetworkReply::pos | ( | ) | const |
For random-access devices, this function returns the position that data is written to or read from.
CFxNAByteArray CFxNANetworkReply::rawHeader | ( | const CFxNAByteArray & | headerName | ) | const |
Returns the raw contents of the header headerName as sent by the remote server.
headerName | Input |
CFxNAList< CFxNAByteArray > CFxNANetworkReply::rawHeaderList | ( | ) | const |
Returns a list of headers fields that were sent by the remote server, in the order that they were sent.
Duplicate headers are merged together and take place of the latter duplicate.
const CFxNAList< RawHeaderPair > & CFxNANetworkReply::rawHeaderPairs | ( | ) | const |
CFxNAByteArray CFxNANetworkReply::readAll | ( | ) |
Reads all remaining data from the device, and returns it as a byte array.
const CFxNANetworkRequest & CFxNANetworkReply::request | ( | ) | const |
Returns the request that was posted for this reply. In special, note that the URL for the request may be different than that of the reply.
bool CFxNANetworkReply::seek | ( | long long | pos | ) |
For random-access devices, this function sets the current position to pos, returning true on success, or false if an error occurred.
pos | Input |
void CFxNANetworkReply::setRequest | ( | const CFxNANetworkRequest & | request | ) |
Sets the associated request for this object to be request. This value will be returned by request().
request | Input |
CFxUISignal< void(long long bytesSent, long long bytesTotal)> & CFxNANetworkReply::uploadProgress | ( | ) |
Signal is emitted to indicate the progress of the upload part of this network request, if there's any. If there's no upload associated with this request, this signal will not be emitted.
The bytesSent parameter indicates the number of bytes uploaded, while bytesTotal indicates the total number of bytes to be uploaded.
If the number of bytes to be uploaded could not be determined, bytesTotal will be -1.
CFxNAUrl CFxNANetworkReply::url | ( | ) | const |
Returns the url of the content downloaded or uploaded.