parse new SERVERNAME config variable

This commit is contained in:
ehouse 2005-10-01 16:09:57 +00:00
parent c5add889cb
commit 0c2365e3ea
2 changed files with 5 additions and 0 deletions

View file

@ -99,6 +99,8 @@ RelayConfigs::RelayConfigs( const char* cfile )
m_port = atoi( value );
} else if ( 0 == strcmp( line, "NTHREADS" ) ) {
m_nWorkerThreads = atoi( value );
} else if ( 0 == strcmp( line, "SERVERNAME" ) ) {
m_serverName = value;
} else {
logf( "unknown key %s with value %s\n",
line, value );

View file

@ -21,6 +21,7 @@
#ifndef _CONFIGS_H_
#define _CONFIGS_H_
#include <string>
#include "xwrelay_priv.h"
class RelayConfigs {
@ -36,6 +37,7 @@ class RelayConfigs {
int GetNWorkerThreads() { return m_nWorkerThreads; }
time_t GetAllConnectedInterval() { return m_allConnInterval; }
time_t GetHeartbeatInterval() { return m_heartbeatInterval; }
const char* GetServerName() { return m_serverName.c_str(); }
private:
@ -46,6 +48,7 @@ class RelayConfigs {
int m_ctrlport;
int m_port;
int m_nWorkerThreads;
std::string m_serverName;
static RelayConfigs* instance;
};