From 71ac37ecfaf5dff76c8880b62228c30bd207054b Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 30 Jul 2008 11:33:15 +0000 Subject: Added global Conf namepsace with configuration values. These are to be filled with config file values later. --- server/src/server.cc | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'server/src/server.cc') diff --git a/server/src/server.cc b/server/src/server.cc index 20fd856..1bd0ccf 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -133,7 +133,7 @@ static void connection(TCPSocket &socket) #ifndef WITHOUT_PENTOMINOS // Send the queries to Pentominos (if any) TCPSocket s; - s.connect("localhost", 11108); + s.connect(Conf::pentominos_addr, Conf::pentominos_port); QueryHandler qh(&s, transaction.cpr); std::vector< Macro >::iterator mi = templ->course.macroes.begin(); @@ -212,14 +212,7 @@ static void connection(TCPSocket &socket) void server() { - int port; - try { - port = config()->lookup("port"); - } catch( ... ) { - fprintf(stderr, "Could not read port."); - return; - } - + port_t port = Conf::server_port; TCPSocket *socket = NULL; try { @@ -237,12 +230,7 @@ void server() { // Reload if new port is assigned. int old_port = port; - try { - port = config()->lookup("port"); - } catch( ... ) { - fprintf(stderr, "Could not read port."); - return; - } + port = Conf::server_port; if(port != old_port) { // Start listening on the new port -- cgit v1.2.3