Classes | |
class | MasterClientInfo |
Signals | |
void | block () |
void | finishedQueryingMaster (MasterClient *master) |
void | sleepingModeEnter () |
void | sleepingModeExit () |
Public Member Functions | |
void | quit () |
void | registerMaster (MasterClient *pMaster) |
void | registerServer (Server *server) |
void | run () |
void | setDelayBetweenResends (int delay) |
Protected Types | |
typedef QHash< MasterClient *, MasterClientInfo * > | MasterHashtable |
typedef QHash< MasterClient *, MasterClientInfo * > ::iterator | MasterHashtableIt |
Protected Slots | |
void | masterFinishedRefreshing (MasterClient *pMaster) |
Protected Member Functions | |
void | attemptTimeoutMasters () |
void | gotoSleep () |
bool | isAnythingToRefresh () const |
Server * | obtainServerFromBatch (ServerBatch &batch, const QHostAddress &address, quint16 port) |
void | readPendingDatagrams () |
void | sendMasterQueries () |
unsigned | sendQueriesForBatch (ServerBatch &batch, int resetDelay, bool firstQuery) |
void | sendServerQueries () |
bool | shouldBlockRefreshingProcess () const |
Returns true if there are any master clients or non-custom servers registered. | |
void | unregisterMaster (MasterClient *pMaster) |
Protected Attributes | |
QTime | batchTime |
bool | bKeepRunning |
int | delayBetweenResends |
QList< ServerBatch > | registeredBatches |
MasterHashtable | registeredMasters |
QSet< Server * > | registeredServers |
QUdpSocket * | socket |
QList< Server * > | unbatchedServers |
QSet< MasterClient * > | unchallengedMasters |
QMutex | thisMutex |
QWaitCondition | thisWaitCondition |
Static Protected Attributes | |
static const int | MASTER_SERVER_TIMEOUT_DELAY = 10000 |
void RefreshingThread::block | ( | ) | [signal] |
Emitted when a master client of non-custom server is registered.
Server * RefreshingThread::obtainServerFromBatch | ( | ServerBatch & | batch, |
const QHostAddress & | address, | ||
quint16 | port | ||
) | [protected] |
void RefreshingThread::quit | ( | ) |
This will set bKeepRunning to false which will tell the refreshing thread to exit gracefully.
void RefreshingThread::registerMaster | ( | MasterClient * | pMaster | ) |
Registers a new master server to be queried. All masters are stored in a hash table, therefore it's impossible to register the same object twice.
void RefreshingThread::registerServer | ( | Server * | server | ) |
Registers a new server to be queried. All servers are stored in a hash table, therefore it's impossible to register the same object twice.
unsigned RefreshingThread::sendQueriesForBatch | ( | ServerBatch & | batch, |
int | resetDelay, | ||
bool | firstQuery | ||
) | [protected] |
void RefreshingThread::setDelayBetweenResends | ( | int | delay | ) | [inline] |
Sets delay between subsequent queries send to the servers. Default value is 1000. Minimum value is 100.
void RefreshingThread::sleepingModeEnter | ( | ) | [signal] |
Emitted when refreshing thread doesn't have anything more to do and goes into sleeping mode.
void RefreshingThread::sleepingModeExit | ( | ) | [signal] |
Emitted when refreshing thread wakes up from sleeping mode and begins refreshing work.
QSet<Server*> RefreshingThread::registeredServers [protected] |
This will keep list of ALL servers to make sure that no server is registered twice.
QMutex RefreshingThread::thisMutex [protected] |
Mutex used by methods of this class.
QWaitCondition RefreshingThread::thisWaitCondition [protected] |
Wait condition used by the methods of this class. Used to wake up the sleeping thread after the registerServer() is called.