Add ability to tune polling speed

master
Timothy Pearson 11 years ago
parent ff484b9d9c
commit 145c83d1b3

@ -49,9 +49,12 @@ struct exit_exception {
instance of this class.
*/
AuthSocket::AuthSocket(int sock, int serverID, TQObject *parent, const char *name) :
TDEKerberosServerSocket(parent, name), m_criticalSection(0), m_stationID(-1), m_bound(false), m_serviceID(0), m_serverID(serverID), m_terminationStamp(0), m_servActive(false), m_servState(0), m_servClientSocket(NULL), m_servClientTimeout(NULL), m_loopTimer(NULL), m_pollTimer(NULL), m_config(static_cast<AuthServer*>(parent)->m_config), m_database(NULL), m_databaseStationsCursor(NULL),
TDEKerberosServerSocket(parent, name), m_criticalSection(0), m_stationID(-1), m_bound(false), m_serviceID(0), m_serverID(serverID), m_pollInterval(100), m_terminationStamp(0), m_servActive(false), m_servState(0), m_servClientSocket(NULL), m_servClientTimeout(NULL), m_loopTimer(NULL), m_pollTimer(NULL), m_config(static_cast<AuthServer*>(parent)->m_config), m_database(NULL), m_databaseStationsCursor(NULL),
m_databaseServicesCursor(NULL), m_databaseServiceTypesCursor(NULL), m_databasePermissionsCursor(NULL), m_databaseActivityCursor(NULL), m_databaseStatisticsCursor(NULL), m_databaseStatusCursor(NULL)
{
// Read settings
m_config->setGroup("Tuning");
m_pollInterval = m_config->readNumEntry("pollInterval", m_pollInterval);
// Initialize timers
m_kerberosInitTimer = new TQTimer();
@ -392,7 +395,7 @@ void AuthSocket::commandLoop() {
if (m_loopTimer) m_loopTimer->start(0, TRUE);
}
else {
if (m_loopTimer) m_loopTimer->start(100, TRUE);
if (m_loopTimer) m_loopTimer->start(m_pollInterval, TRUE);
}
return;
}
@ -692,7 +695,7 @@ void AuthSocket::commandLoop() {
if (m_loopTimer) m_loopTimer->start(0, TRUE);
}
else {
if (m_loopTimer) m_loopTimer->start(100, TRUE);
if (m_loopTimer) m_loopTimer->start(m_pollInterval, TRUE);
}
return;
}

@ -64,7 +64,7 @@ class AuthSocket : public TDEKerberosServerSocket
private:
void updateStatistics(int eventType);
private:
int line;
int m_criticalSection;
@ -73,6 +73,7 @@ class AuthSocket : public TDEKerberosServerSocket
bool m_bound;
int m_serviceID;
int m_serverID;
int m_pollInterval;
TQ_ULLONG m_terminationStamp;
bool m_servActive;
@ -127,4 +128,4 @@ class AuthServer : public TQServerSocket
friend class AuthSocket;
};
};

Loading…
Cancel
Save