MCPcopy Create free account
hub / github.com/alibaba/async_simple / main

Function main

demo_example/async_echo_client.cpp:59–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59int main(int argc, char *argv[]) {
60 try {
61 asio::io_context io_context;
62 std::thread thd([&io_context] {
63 asio::io_context::work work(io_context);
64 io_context.run();
65 });
66 async_simple::coro::syncAwait(start(io_context, "127.0.0.1", "9980"));
67 io_context.stop();
68 thd.join();
69 std::cout << "Finished ok, client quit.\n";
70 } catch (std::exception &e) {
71 std::cerr << "Exception: " << e.what() << "\n";
72 }
73
74 return 0;
75}

Callers

nothing calls this directly

Calls 6

syncAwaitFunction · 0.85
whatMethod · 0.80
startFunction · 0.70
runMethod · 0.45
stopMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected