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

Function main

example/cpp11/timeouts/async_tcp_client.cpp:287–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285};
286
287int main(int argc, char* argv[])
288{
289 try
290 {
291 if (argc != 3)
292 {
293 std::cerr << "Usage: client <host> <port>\n";
294 return 1;
295 }
296
297 boost::asio::io_context io_context;
298 tcp::resolver r(io_context);
299 client c(io_context);
300
301 c.start(r.resolve(argv[1], argv[2]));
302
303 io_context.run();
304 }
305 catch (std::exception& e)
306 {
307 std::cerr << "Exception: " << e.what() << "\n";
308 }
309
310 return 0;
311}

Callers

nothing calls this directly

Calls 3

startMethod · 0.45
resolveMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected