Torc
0.1
|
Subclass of QNetworkAccessManager for sending network requests and monitoring the network state. More...
#include <torcnetwork.h>
Signals | |
void | NewRequest (TorcNetworkRequest *Request) |
void | CancelRequest (TorcNetworkRequest *Request) |
void | PokeRequest (TorcNetworkRequest *Request) |
void | NewAsyncRequest (TorcNetworkRequest *Request, QObject *Parent) |
Public Member Functions | |
virtual | ~TorcNetwork () |
Static Public Member Functions | |
static bool | IsAvailable (void) |
static bool | IsOwnAddress (const QHostAddress &Address) |
static bool | Get (TorcNetworkRequest *Request) |
static void | Cancel (TorcNetworkRequest *Request) |
static void | Poke (TorcNetworkRequest *Request) |
static bool | GetAsynchronous (TorcNetworkRequest *Request, QObject *Parent) |
Queue an asynchronous HTTP request. More... | |
static void | AddHostName (const QString &Host) |
Register a known host name for this application. More... | |
static void | RemoveHostName (const QString &Host) |
Remove a host name from the known list of host names. More... | |
static QStringList | GetHostNames (void) |
Retrieve the list of currently identified host names. More... | |
static QString | IPAddressToLiteral (const QHostAddress &Address, int Port, bool UseLocalhost=true) |
Convert an IP address to a string literal. More... | |
static bool | IsExternal (const QHostAddress &Address) |
Returns true if the address is accessible from other devices. More... | |
static bool | IsLinkLocal (const QHostAddress &Address) |
static bool | IsLocal (const QHostAddress &Address) |
static bool | IsGlobal (const QHostAddress &Address) |
static QList< QSslError > | AllowableSslErrors (const QList< QSslError > &Errors) |
Protected Slots | |
void | ConfigurationAdded (const QNetworkConfiguration &Config) |
void | ConfigurationChanged (const QNetworkConfiguration &Config) |
void | ConfigurationRemoved (const QNetworkConfiguration &Config) |
void | OnlineStateChanged (bool Online) |
void | UpdateCompleted (void) |
void | ReadyRead (void) |
void | Finished (void) |
void | Error (QNetworkReply::NetworkError Code) |
void | SSLErrors (const QList< QSslError > &Errors) |
void | DownloadProgress (qint64 Received, qint64 Total) |
void | Authenticate (QNetworkReply *Reply, QAuthenticator *Authenticator) |
void | NewHostName (const QHostInfo &Info) |
Receives host name updates from QHostInfo. More... | |
Protected Member Functions | |
TorcNetwork () | |
bool | IsOnline (void) |
bool | IsOwnAddressPriv (const QHostAddress &Address) |
bool | CheckHeaders (TorcNetworkRequest *Request, QNetworkReply *Reply) |
bool | Redirected (TorcNetworkRequest *Request, QNetworkReply *Reply) |
void | CloseConnections (void) |
Cancel all current network requests. More... | |
void | UpdateConfiguration (bool Creating=false) |
Static Protected Member Functions | |
static void | Setup (bool Create) |
Friends | |
class | TorcNetworkObject |
Subclass of QNetworkAccessManager for sending network requests and monitoring the network state.
Definition at line 22 of file torcnetwork.h.
|
virtual |
Definition at line 344 of file torcnetwork.cpp.
|
protected |
Definition at line 313 of file torcnetwork.cpp.
|
static |
Register a known host name for this application.
Host names are currently used to validate cross domain HTTP requests. New host names are added via reverse DNS lookup when an external network connection becomes available and via successful Bonjour services registration events (Bonjour typically uses a different host name).
Definition at line 131 of file torcnetwork.cpp.
|
static |
Definition at line 645 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 707 of file torcnetwork.cpp.
|
static |
Definition at line 73 of file torcnetwork.cpp.
|
signal |
|
protected |
Definition at line 480 of file torcnetwork.cpp.
|
protected |
Cancel all current network requests.
This method can be called when the TorcNetwork singleton is being destroyed, when network access has been disallowed or when the network is down. It is reasonable to expect outstanding requests in the latter 2 cases but well behaved clients should have cancelled any requests in the first case. Hence we warn in this instance.
Definition at line 735 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 451 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 457 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 463 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 698 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 633 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 601 of file torcnetwork.cpp.
|
static |
Definition at line 60 of file torcnetwork.cpp.
|
static |
Queue an asynchronous HTTP request.
This is a method for Parent objects that are QObject subclasses residing in a full QThread. The parent must implement a RequestReady(TorcNetworkRequest*) public slot, which will be invoked once the download is complete. There is no need to cancel the request unless it is no longer required.
Definition at line 94 of file torcnetwork.cpp.
|
static |
Retrieve the list of currently identified host names.
Definition at line 183 of file torcnetwork.cpp.
|
static |
Convert an IP address to a string literal.
For an IPv4 address, this is a no-op. For IPv6 addresses, we need to remove the scope Id if present and wrap the remainder in braces.
Definition at line 196 of file torcnetwork.cpp.
|
static |
Definition at line 46 of file torcnetwork.cpp.
|
static |
Returns true if the address is accessible from other devices.
Definition at line 222 of file torcnetwork.cpp.
|
static |
Definition at line 258 of file torcnetwork.cpp.
|
static |
Definition at line 229 of file torcnetwork.cpp.
|
static |
Definition at line 238 of file torcnetwork.cpp.
|
protected |
Definition at line 352 of file torcnetwork.cpp.
|
static |
Definition at line 53 of file torcnetwork.cpp.
|
protected |
Definition at line 357 of file torcnetwork.cpp.
|
signal |
|
protectedslot |
Receives host name updates from QHostInfo.
Definition at line 715 of file torcnetwork.cpp.
|
signal |
|
protectedslot |
Definition at line 469 of file torcnetwork.cpp.
|
static |
Definition at line 80 of file torcnetwork.cpp.
|
signal |
|
protectedslot |
Definition at line 572 of file torcnetwork.cpp.
|
protected |
Definition at line 536 of file torcnetwork.cpp.
|
static |
Remove a host name from the known list of host names.
Definition at line 159 of file torcnetwork.cpp.
|
staticprotected |
Definition at line 271 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 687 of file torcnetwork.cpp.
|
protectedslot |
Definition at line 475 of file torcnetwork.cpp.
|
protected |
Definition at line 748 of file torcnetwork.cpp.
|
friend |
Definition at line 24 of file torcnetwork.h.