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

Function echo

example/cpp20/coroutines/refactored_echo_server.cpp:33–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33awaitable<void> echo(tcp::socket socket)
34{
35 try
36 {
37 for (;;)
38 {
39 // The asynchronous operations to echo a single chunk of data have been
40 // refactored into a separate function. When this function is called, the
41 // operations are still performed in the context of the current
42 // coroutine, and the behaviour is functionally equivalent.
43 co_await echo_once(socket);
44 }
45 }
46 catch (std::exception& e)
47 {
48 std::printf("echo Exception: %s\n", e.what());
49 }
50}
51
52awaitable<void> listener()
53{

Callers 1

listenerFunction · 0.70

Calls 1

echo_onceFunction · 0.70

Tested by

no test coverage detected