]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/example/cpp03/http/server/main.cpp
5 // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
13 #include <boost/asio.hpp>
14 #include <boost/bind.hpp>
17 int main(int argc
, char* argv
[])
21 // Check command line arguments.
24 std::cerr
<< "Usage: http_server <address> <port> <doc_root>\n";
25 std::cerr
<< " For IPv4, try:\n";
26 std::cerr
<< " receiver 0.0.0.0 80 .\n";
27 std::cerr
<< " For IPv6, try:\n";
28 std::cerr
<< " receiver 0::0 80 .\n";
32 // Initialise the server.
33 http::server::server
s(argv
[1], argv
[2], argv
[3]);
35 // Run the server until stopped.
38 catch (std::exception
& e
)
40 std::cerr
<< "exception: " << e
.what() << "\n";