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

Function main

demo_example/http/coroutine_http/http_client.cpp:104–118  ·  view source on GitHub ↗

Copy the the file async_simple/demo_example/http/index.html to http server directory before run the http client, otherwise you will get 404 not found error message.

Source from the content-addressed store, hash-verified

102// directory before run the http client, otherwise you will get 404 not found
103// error message.
104int main(int argc, char *argv[]) {
105 try {
106 asio::io_context io_context;
107 std::thread thd([&io_context] {
108 asio::io_context::work work(io_context);
109 io_context.run();
110 });
111 async_simple::coro::syncAwait(start(io_context, "127.0.0.1", "9980"));
112 io_context.stop();
113 thd.join();
114 std::cout << "Finished ok, client quit.\n";
115 } catch (std::exception &e) {
116 std::cerr << "Exception: " << e.what() << "\n";
117 }
118}

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