KNetwork::KResolverWorkerBase Class Reference
Collaboration diagram for KNetwork::KResolverWorkerBase:
Public Member Functions | |
KResolverWorkerBase () | |
virtual | ~KResolverWorkerBase () |
QString | nodeName () const |
QString | serviceName () const |
int | flags () const |
int | familyMask () const |
int | socketType () const |
int | protocol () const |
QCString | protocolName () const |
void | finished () |
Public Attributes | |
KResolverResults | results |
Protected Member Functions | |
virtual bool | run ()=0 |
virtual bool | preprocess ()=0 |
virtual bool | postprocess () |
void | setError (int errorcode, int syserror=0) |
bool | enqueue (KResolver *other) |
bool | enqueue (KResolverWorkerBase *worker) |
bool | checkResolver () |
void | acquireResolver () |
void | releaseResolver () |
Friends | |
class | KNetwork::Internal::KResolverThread |
class | KNetwork::Internal::KResolverManager |
class | KResolverWorkerBase::ResolverLocker |
Classes | |
class | ResolverLocker |
Helper class for locking the resolver subsystem. More... |
Detailed Description
Definition at line 60 of file kresolverworkerbase.h.
Member Function Documentation
|
This is the hostname to be looked for.
Definition at line 48 of file kresolverworkerbase.cpp. |
|
And this is the service name.
Definition at line 55 of file kresolverworkerbase.cpp. |
|
gets the flags
Definition at line 62 of file kresolverworkerbase.cpp. |
|
gets the family mask
Definition at line 69 of file kresolverworkerbase.cpp. |
|
gets the socket type
Definition at line 76 of file kresolverworkerbase.cpp. |
|
gets the protocol number
Definition at line 83 of file kresolverworkerbase.cpp. |
|
gets the protocol name, if applicable
Definition at line 90 of file kresolverworkerbase.cpp. |
|
Call this function to indicate that processing has finished. This is useful in the preprocessing stage, to indicate that run doesn't have to be called. Definition at line 98 of file kresolverworkerbase.cpp. |
|
This is the function that should be overriden in derived classes. Derived classes will do their blocking job in this function and return either success or failure to work (not the lookup). That is, whether the lookup result was a domain found or not, if we got our answer, we should indicate success. The error itself must be set with setError. Important: this function gets called in a separate thread!
|
|
This function gets called during pre processing for this class and you must override it. Important: this function gets called in the main event thread. And it MUST NOT block. This function can be used for an object to determine if it will be able to resolve the given data or not even before launching into a blocking operation. This function should return true if the object is capable of handling this kind of data; false otherwise. Note that the return value of 'true' means that the object's blocking answer will be considered authoritative. This function MUST NOT queue further requests. Leave that to run. This function is pure virtual; you must override it.
|
|
This function gets called during post processing for this class. Important: this function gets called in the main event thread. And it MUST NOT block.
Definition at line 103 of file kresolverworkerbase.cpp. |
|
Sets the error.
Definition at line 227 of file kresolverworkerbase.h. References results, and KNetwork::KResolverResults::setError(). |
|
Enqueue the given resolver for post-processing. Use this function to make the manager call for another resolution. This is suitable for workers that do post-processing. The manager will make sure that any requests enqueued by this function are done before calling the postprocessing function, which you should override. Important: do use KResolver's own enqueueing functions (i.e., KResolver::start). Instead, use this function.
|
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 108 of file kresolverworkerbase.cpp. |
|
Checks the resolver subsystem status.
Definition at line 122 of file kresolverworkerbase.cpp. |
|
This function has to be called from the resolver workers that require use of the DNS resolver code (i.e. , res_* functions, generally in libresolv). It indicates that the function is starting a resolution and that the resolver backend shouldn't change asynchronously. If any pending res_init's are required, they will be performed before this function returns.
Definition at line 128 of file kresolverworkerbase.cpp. Referenced by KNetwork::KResolverWorkerBase::ResolverLocker::openClose(), and KNetwork::KResolverWorkerBase::ResolverLocker::ResolverLocker(). |
|
This function is the counterpart for acquireResolver: the worker thread indicates that it's done with the resolver.
Definition at line 134 of file kresolverworkerbase.cpp. Referenced by KNetwork::KResolverWorkerBase::ResolverLocker::openClose(), and KNetwork::KResolverWorkerBase::ResolverLocker::~ResolverLocker(). |
Member Data Documentation
|
Derived classes will put their resolved data in this list, or will leave it empty in case of error. Status and error codes should also be stored in this object (the setError function does that). Definition at line 125 of file kresolverworkerbase.h. Referenced by setError(). |
The documentation for this class was generated from the following files: