| 88 | } |
| 89 | |
| 90 | static AwaitTask echoConversation(AwaitEventLoop& await, const SocketDescriptor& serverSocket, |
| 91 | const SocketDescriptor& client, SocketIPAddress address, SocketDescriptor& accepted, |
| 92 | Span<char> replyBuffer, AwaitSocketReceiveResult& reply) |
| 93 | { |
| 94 | AwaitTask server = echoServer(await, serverSocket, accepted); |
| 95 | AwaitTask clientTask = echoClient(await, client, address, replyBuffer, reply); |
| 96 | |
| 97 | AwaitTask* children[2] = {&server, &clientTask}; |
| 98 | AwaitTaskGroup group(await, children); |
| 99 | SC_CO_TRY(group.spawnAll(children)); |
| 100 | Result waitResult = co_await group.waitAll(); |
| 101 | if (not waitResult) |
| 102 | { |
| 103 | co_return Result::Error("AwaitEcho task group failed"); |
| 104 | } |
| 105 | |
| 106 | co_return Result(true); |
| 107 | } |
| 108 | |
| 109 | static Result runAwaitEcho() |
| 110 | { |
no test coverage detected