| 53 | } |
| 54 | |
| 55 | static AwaitTask probeClient(AwaitEventLoop& await, const SocketDescriptor& client, SocketIPAddress address, |
| 56 | Span<char> replyBuffer, AwaitSocketReceiveResult& reply) |
| 57 | { |
| 58 | const char request[] = "PING"; |
| 59 | |
| 60 | SC_CO_TRY(co_await await.connect(client, address)); |
| 61 | SC_CO_TRY(co_await await.sendAll(client, {request, sizeof(request) - 1})); |
| 62 | SC_CO_TRY(co_await await.receive(client, replyBuffer, reply)); |
| 63 | |
| 64 | StringView text({reply.data.data(), reply.data.sizeInBytes()}, false, StringEncoding::Ascii); |
| 65 | if (text != "PONG") |
| 66 | { |
| 67 | co_return Result::Error("AwaitServiceProbe received an unexpected response"); |
| 68 | } |
| 69 | |
| 70 | co_return Result(true); |
| 71 | } |
| 72 | |
| 73 | static AwaitTask slowMaintenance(AwaitEventLoop& await) |
| 74 | { |
no test coverage detected