/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2011-2012 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * \file Server.cpp * * This file strongly follows the Serialization example from the boost::asio * library (see server.cpp) * * Created on: Oct 21, 2011 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif // boost asio needs specific operator new #include #include "CodePatterns/MemDebug.hpp" #include #include #include "atexit.hpp" #include "CodePatterns/Info.hpp" #include "CodePatterns/Log.hpp" #include "FragmentScheduler.hpp" int main(int argc, char* argv[]) { // from this moment on, we need to be sure to deinitialize in the correct order // this is handled by the cleanup function atexit(cleanUp); setVerbosity(3); size_t Exitflag = 0; try { // Check command line arguments. if (argc != 3) { std::cerr << "Usage: " << argv[0] << " " << std::endl; return 1; } unsigned short workerport = boost::lexical_cast(argv[1]); unsigned short controllerport = boost::lexical_cast(argv[2]); boost::asio::io_service io_service; FragmentScheduler Server(io_service, workerport, controllerport); { Info info("io_service"); io_service.run(); } Exitflag = Server.getExitflag(); } catch (std::exception& e) { std::cerr << e.what() << std::endl; } return Exitflag; }