From 7f650460c739b7d079ce42fcf015b7aa0869b1bd Mon Sep 17 00:00:00 2001 From: Rex Schilasky <49162693+rex-schilasky@users.noreply.github.com> Date: Fri, 28 Jun 2024 11:46:39 +0200 Subject: [PATCH] [samples] shutdown condition fixed (#1641) --- samples/cpp/services/latency_client/src/latency_client.cpp | 4 ++-- samples/cpp/services/math_client/src/math_client.cpp | 4 ++-- samples/cpp/services/ping_client/src/ping_client.cpp | 4 ++-- samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/cpp/services/latency_client/src/latency_client.cpp b/samples/cpp/services/latency_client/src/latency_client.cpp index b5523f88b1..2c9a5f07d4 100644 --- a/samples/cpp/services/latency_client/src/latency_client.cpp +++ b/samples/cpp/services/latency_client/src/latency_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ int main(int argc, char** argv) eCAL::CServiceClient latency_client("latency"); // waiting for service - while (!latency_client.IsConnected()) + while (eCAL::Ok() && !latency_client.IsConnected()) { std::this_thread::sleep_for(std::chrono::milliseconds(500)); std::cout << "Waiting for the service .." << std::endl; diff --git a/samples/cpp/services/math_client/src/math_client.cpp b/samples/cpp/services/math_client/src/math_client.cpp index ed0eae551e..4c31821474 100644 --- a/samples/cpp/services/math_client/src/math_client.cpp +++ b/samples/cpp/services/math_client/src/math_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ int main(int argc, char **argv) int inp2(0); // waiting for service - while (!math_client.IsConnected()) + while (eCAL::Ok() && !math_client.IsConnected()) { std::this_thread::sleep_for(std::chrono::milliseconds(500)); std::cout << "Waiting for the service .." << std::endl; diff --git a/samples/cpp/services/ping_client/src/ping_client.cpp b/samples/cpp/services/ping_client/src/ping_client.cpp index 75ab654eed..e2022da6cb 100644 --- a/samples/cpp/services/ping_client/src/ping_client.cpp +++ b/samples/cpp/services/ping_client/src/ping_client.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ int main(int argc, char **argv) eCAL::protobuf::CServiceClient ping_client("ping service"); // waiting for service - while (!ping_client.IsConnected()) + while (eCAL::Ok() && !ping_client.IsConnected()) { std::this_thread::sleep_for(std::chrono::milliseconds(500)); std::cout << "Waiting for the service .." << std::endl; diff --git a/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp b/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp index 47efbf0de8..805db5e016 100644 --- a/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp +++ b/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ int main(int argc, char **argv) eCAL::CServiceClient ping_client(service_name); // waiting for service - while (!ping_client.IsConnected()) + while (eCAL::Ok() && !ping_client.IsConnected()) { std::this_thread::sleep_for(std::chrono::milliseconds(500)); std::cout << "Waiting for the service .." << std::endl;