From 145c83d1b310439d2aa39f52a49a5812f7c14102 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 29 Oct 2013 17:11:18 -0500 Subject: Add ability to tune polling speed --- servers/auth_server_lin/src/auth_conn.cpp | 9 ++++++--- servers/auth_server_lin/src/auth_conn.h | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'servers/auth_server_lin') diff --git a/servers/auth_server_lin/src/auth_conn.cpp b/servers/auth_server_lin/src/auth_conn.cpp index 2711cc4..bd88624 100644 --- a/servers/auth_server_lin/src/auth_conn.cpp +++ b/servers/auth_server_lin/src/auth_conn.cpp @@ -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(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(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; } diff --git a/servers/auth_server_lin/src/auth_conn.h b/servers/auth_server_lin/src/auth_conn.h index 612b671..7cf3ef9 100644 --- a/servers/auth_server_lin/src/auth_conn.h +++ b/servers/auth_server_lin/src/auth_conn.h @@ -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; -}; \ No newline at end of file +}; -- cgit v1.2.1