MCPcopy Create free account
hub / github.com/boostorg/asio / main

Function main

example/cpp11/iostreams/daytime_server.cpp:25–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25int main()
26{
27 try
28 {
29 boost::asio::io_context io_context;
30
31 tcp::endpoint endpoint(tcp::v4(), 13);
32 tcp::acceptor acceptor(io_context, endpoint);
33
34 for (;;)
35 {
36 tcp::iostream stream;
37 boost::system::error_code ec;
38 acceptor.accept(stream.socket(), ec);
39 if (!ec)
40 {
41 stream << make_daytime_string();
42 }
43 }
44 }
45 catch (std::exception& e)
46 {
47 std::cerr << e.what() << std::endl;
48 }
49
50 return 0;
51}

Callers

nothing calls this directly

Calls 2

make_daytime_stringFunction · 0.70
acceptMethod · 0.45

Tested by

no test coverage detected