summaryrefslogtreecommitdiff
path: root/orkbasecxx/MultiThreadedServer.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/MultiThreadedServer.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/MultiThreadedServer.cpp')
-rw-r--r--orkbasecxx/MultiThreadedServer.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/orkbasecxx/MultiThreadedServer.cpp b/orkbasecxx/MultiThreadedServer.cpp
index 7cbf4db..cec42db 100644
--- a/orkbasecxx/MultiThreadedServer.cpp
+++ b/orkbasecxx/MultiThreadedServer.cpp
@@ -41,17 +41,20 @@ void CommandLineServer::run(void* args)
s_log = log4cxx::Logger::getLogger("interface.commandlineserver");
unsigned short tcpPort = (unsigned short)(unsigned long)args;
+ //unsigned short tcpPort = (unsigned short)*(int*)args;
+
CommandLineAcceptor peer_acceptor;
ACE_INET_Addr addr (tcpPort);
ACE_Reactor reactor;
+ CStdString tcpPortString = IntToString(tcpPort);
if (peer_acceptor.open (addr, &reactor) == -1)
{
- CStdString tcpPortString = IntToString(tcpPort);
LOG4CXX_ERROR(s_log, CStdString("Failed to start command line server on port:") + tcpPortString);
}
else
{
+ LOG4CXX_INFO(s_log, CStdString("Started command line server on port:")+tcpPortString);
for(;;)
{
reactor.handle_events();
@@ -138,17 +141,20 @@ void HttpServer::run(void* args)
s_log = log4cxx::Logger::getLogger("interface.httpserver");
unsigned short tcpPort = (unsigned short)(unsigned long)args;
+ //unsigned short tcpPort = (unsigned short)*(int*)args;
+
HttpAcceptor peer_acceptor;
ACE_INET_Addr addr (tcpPort);
ACE_Reactor reactor;
+ CStdString tcpPortString = IntToString(tcpPort);
if (peer_acceptor.open (addr, &reactor) == -1)
{
- CStdString tcpPortString = IntToString(tcpPort);
LOG4CXX_ERROR(s_log, CStdString("Failed to start http server on port:") + tcpPortString);
}
else
{
+ LOG4CXX_INFO(s_log, CStdString("Started HTTP server on port:")+tcpPortString);
for(;;)
{
reactor.handle_events();