diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2025-01-10 13:06:32 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2025-01-10 14:43:49 +0200 |
commit | a89eac8f101fd6cd88b4a93dee02de03dab36c21 (patch) | |
tree | f6feec25206cb083720da5c4f7b06240970d9398 | |
parent | 81e1e631c495b8e8ab1fe479c0ddcd7744d81eda (diff) |
main: Wait until the channel is readyHEADtrout_19.90.0trout/19.90.019.90.0master
With the rpi platform support for agl-kvm we seem to be hitting the same
issue as on the receiver side - due the gRPC channel not being in ready
state. We start at similar time as the gRPC proxy server/compositor.
Bug-AGL: SPEC-5305
Change-Id: I54a54a0b16ae9341e70b3f168eee49dbc9180259
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
-rw-r--r-- | app/AglShellGrpcClient.cpp | 4 | ||||
-rw-r--r-- | app/main.cpp | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/AglShellGrpcClient.cpp b/app/AglShellGrpcClient.cpp index 8577f16..3c7471b 100644 --- a/app/AglShellGrpcClient.cpp +++ b/app/AglShellGrpcClient.cpp @@ -41,11 +41,11 @@ GrpcClient::WaitForConnected(int wait_time_ms, int tries_timeout) clock_gettime(CLOCK_MONOTONIC, &ts); ts.tv_sec = 0; - ts.tv_nsec = 500 * 1000 * 1000; // 500ms + ts.tv_nsec = wait_time_ms * 1000 * 1000; while (((state = m_channel->GetState(true)) != GRPC_CHANNEL_READY) && try_++ < tries_timeout) { - fprintf(stderr, "waiting for channel state to be ready, current state %d", state); + fprintf(stderr, "waiting for channel state to be ready, current state %d\n", state); nanosleep(&ts, NULL); } diff --git a/app/main.cpp b/app/main.cpp index 71e2d13..d5f756a 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -48,6 +48,7 @@ int main(int argc, char *argv[]) std::string output = read_config_and_get_output(); GrpcClient *client = new GrpcClient(); + client->WaitForConnected(500, 10); if (!output.empty()) client->SetAppOnOutput(our_name, output); else |