// // server.cpp // ~~~~~~~~~~ // // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include #include #include #include "StockServer.hpp" int main(int argc, char* argv[]) { try { // Check command line arguments. if (argc != 2) { std::cerr << "Usage: server " << std::endl; return 1; } unsigned short port = boost::lexical_cast(argv[1]); boost::asio::io_service io_service; StockServer server(io_service, port); io_service.run(); } catch (std::exception& e) { std::cerr << e.what() << std::endl; } return 0; }