/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2012 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * ServerOptions.cpp * * Created on: 01.06.2012 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include "ServerOptions.hpp" #include "CodePatterns/Log.hpp" int ServerOptions::parseWorkerPort(boost::program_options::variables_map &vm) { if (vm.count("workerport")) { try { workerport = vm["workerport"].as< unsigned short >(); } catch (boost::bad_lexical_cast) { ELOG(1, "Could not read " << workerport << " as digits."); return 255; } LOG(1, "INFO: Using " << workerport << " as listen port for worker."); } else { ELOG(1, "Requiring listen port for worker."); return 255; } return 0; } int ServerOptions::parseControllerPort(boost::program_options::variables_map &vm) { if (vm.count("controllerport")) { try { controllerport = vm["controllerport"].as< unsigned short >(); } catch (boost::bad_lexical_cast) { ELOG(1, "Could not read " << controllerport << " as digits."); return 255; } LOG(1, "INFO: Using " << controllerport << " as listen port for controller."); } else { ELOG(1, "Requiring listen port for controller."); return 255; } return 0; }