summaryrefslogtreecommitdiff
path: root/orkbasecxx/Config.cpp
diff options
context:
space:
mode:
authorGerald Begumisa <ben_g@users.sourceforge.net>2007-07-19 09:34:07 +0000
committerGerald Begumisa <ben_g@users.sourceforge.net>2007-07-19 09:34:07 +0000
commitabf1495c5e6e33a93a0277ef301643e7ff2ab4dd (patch)
treedc8a36564f3760f36060b5a1c0c9a6f07ef444fc /orkbasecxx/Config.cpp
parenta78ef547ae120f95a2569c9643cd60992ba547c7 (diff)
Multiple orkaudio instances may be ran on one server by setting the environment variables ORKAUDIO_CONFIG_PATH and ORKAUDIO_LOGGING_PATH to point to the location of the configuration files and log files respectively. Two variables in config.xml <CommandLineServerPort> and <HttpServerPort> have been added which specify the ports for the command line server and HTTP server respectively - these default to 59130 and 59140 respectively, note that previously the default ports were 10000 and 20000 respectively.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@455 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx/Config.cpp')
-rw-r--r--orkbasecxx/Config.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/orkbasecxx/Config.cpp b/orkbasecxx/Config.cpp
index e93a762..334864f 100644
--- a/orkbasecxx/Config.cpp
+++ b/orkbasecxx/Config.cpp
@@ -14,6 +14,7 @@
#define _WINSOCKAPI_ // prevents the inclusion of winsock.h
#include "ace/OS_NS_unistd.h"
+#include "ace/OS_NS_dirent.h"
#include "Utils.h"
#include "serializers/Serializer.h"
#include "Config.h"
@@ -58,6 +59,9 @@ Config::Config()
m_remoteProcessingHostname = REMOTE_PROCESSING_HOSTNAME_DEFAULT;
m_remoteProcessingTcpPort = REMOTE_PROCESSING_TCP_PORT_DEFAULT;
m_remoteProcessingServiceName = REMOTE_PROCESSING_SERVICE_NAME_DEFAULT;
+
+ m_commandLineServerPort = COMMAND_LINE_SERVER_PORT_DEFAULT;
+ m_httpServerPort = HTTP_SERVER_PORT_DEFAULT;
}
void Config::Define(Serializer* s)
@@ -84,7 +88,26 @@ void Config::Define(Serializer* s)
s->StringValue(SERVICE_NAME_PARAM, m_serviceName);
s->IntValue(REPORTING_RETRY_DELAY_PARAM, m_reportingRetryDelay);
s->IntValue(CLIENT_TIMEOUT_PARAM, m_clientTimeout);
- s->StringValue(AUDIO_OUTPUT_PATH_PARAM, m_audioOutputPath);
+
+ /* As per Ticket 174, with reference to
+ * http://wush.net/trac/grinob/wiki/MultipleOrkaudioPerServer
+ */
+ char *loggingPath = NULL;
+ int pathSet = 0;
+
+ loggingPath = ACE_OS::getenv("ORKAUDIO_LOGGING_PATH");
+ if(loggingPath) {
+ ACE_DIR* dir = ACE_OS::opendir(loggingPath);
+ if(dir) {
+ ACE_OS::closedir(dir);
+ m_audioOutputPath.Format("%s", loggingPath);
+ pathSet = 1;
+ }
+ }
+
+ if(!pathSet)
+ s->StringValue(AUDIO_OUTPUT_PATH_PARAM, m_audioOutputPath);
+
s->IntValue(IMMEDIATE_PROCESSING_QUEUE_SIZE_PARAM, m_immediateProcessingQueueSize);
s->IntValue(BATCH_PROCESSING_QUEUE_SIZE_PARAM, m_batchProcessingQueueSize);
s->BoolValue(BATCH_PROCESSING_ENHANCE_PRIORITY_PARAM, m_batchProcessingEnhancePriority);
@@ -100,6 +123,8 @@ void Config::Define(Serializer* s)
s->StringValue(REMOTE_PROCESSING_HOSTNAME_PARAM, m_remoteProcessingHostname);
s->IntValue(REMOTE_PROCESSING_TCP_PORT_PARAM, m_remoteProcessingTcpPort);
s->StringValue(REMOTE_PROCESSING_SERVICE_NAME_PARAM, m_remoteProcessingServiceName);
+ s->IntValue(COMMAND_LINE_SERVER_PORT_PARAM, m_commandLineServerPort);
+ s->IntValue(HTTP_SERVER_PORT_PARAM, m_httpServerPort);
}
void Config::Validate()