]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/asio/example/cpp03/iostreams/daytime_client.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>
15 using boost::asio::ip::tcp
;
17 int main(int argc
, char* argv
[])
23 std::cerr
<< "Usage: daytime_client <host>" << std::endl
;
27 tcp::iostream
s(argv
[1], "daytime");
30 std::cout
<< "Unable to connect: " << s
.error().message() << std::endl
;
35 std::getline(s
, line
);
36 std::cout
<< line
<< std::endl
;
38 catch (std::exception
& e
)
40 std::cout
<< "Exception: " << e
.what() << std::endl
;