56 #include "QtCore/qcoreapplication.h" 57 #include "private/qcoreapplication_p.h" 58 #include "QtNetwork/qhostinfo.h" 59 #include "QtCore/qmutex.h" 60 #include "QtCore/qwaitcondition.h" 61 #include "QtCore/qobject.h" 62 #include "QtCore/qpointer.h" 63 #include "QtCore/qthread.h" 64 #include "QtCore/qthreadpool.h" 65 #include "QtCore/qmutex.h" 66 #include "QtCore/qrunnable.h" 67 #include "QtCore/qlist.h" 68 #include "QtCore/qqueue.h" 69 #include <QElapsedTimer> 72 #include <QNetworkSession> 73 #include <QSharedPointer> 104 #ifndef QT_NO_BEARERMANAGEMENT 110 static void abortHostLookup(
int lookupId);
123 #ifndef QT_NO_BEARERMANAGEMENT 152 void setEnabled(
bool e);
183 virtual void clear() = 0;
206 void abortLookup(
int id);
210 bool wasAborted(
int id);
232 class QSymbianHostResolver :
public CActive
236 ~QSymbianHostResolver();
238 void requestHostLookup();
239 void abortHostLookup();
242 void returnResults();
250 TInt RunError(TInt aError);
252 void processNameResult();
253 void nextNameResult();
254 void processAddressResult();
263 RSocketServ& iSocketServ;
264 RHostResolver iHostResolver;
267 TNameEntry iNameResult;
289 QSymbianHostInfoLookupManager();
290 ~QSymbianHostInfoLookupManager();
292 static QSymbianHostInfoLookupManager* globalInstance();
298 void scheduleLookup(QSymbianHostResolver *r);
299 void abortLookup(
int id);
302 void lookupFinished(QSymbianHostResolver *r);
305 void runNextLookup();
308 static const int KMaxConcurrentLookups = 5;
321 #endif // QHOSTINFO_P_H
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
void emitResultsReady(const QHostInfo &info)
The QQueue class is a generic container that provides a queue.
The QMutex class provides access serialization between threads.
QList< QHostAddress > addrs
QAbstractHostInfoLookupManager()
void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
QHostInfo Q_NETWORK_EXPORT qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char *member, bool *valid, int *id)
static void clear(QVariant::Private *d)
#define QT_TRANSLATE_NOOP(scope, x)
Marks the string literal sourceText for dynamic translation in the given context; i...
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
The QElapsedTimer class provides a fast way to calculate elapsed times.
The QRunnable class is the base class for all runnable objects.
void waitForThreadPoolDone()
The QThreadPool class manages a collection of QThreads.
QCache< QString, QHostInfoCacheElement > cache
#define QT_BEGIN_NAMESPACE
This macro expands to.
QList< int > abortedLookups
void waitForDone()
Waits for each thread to exit and removes all threads from the thread pool.
QHostInfo::HostInfoError err
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
The QHostInfo class provides static functions for host name lookups.
void resultsReady(const QHostInfo &info)
QList< QHostInfoRunnable * > currentLookups
~QAbstractHostInfoLookupManager()
#define Q_AUTOTEST_EXPORT
QHostInfoResult resultEmitter
QFuture< T > run(Function function,...)
HostInfoError
This enum describes the various errors that can occur when trying to resolve a host name...
The QHostAddress class provides an IP address.
QList< QHostInfoRunnable * > finishedLookups
QQueue< QHostInfoRunnable * > scheduledLookups
QList< QHostInfoRunnable * > postponedLookups
void Q_AUTOTEST_EXPORT qt_qhostinfo_clear_cache()