Skip to content

Commit

Permalink
[samples] shutdown condition fixed (#1641)
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed Jun 28, 2024
1 parent 3923a1d commit 0581cb5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions samples/cpp/services/latency_client/src/latency_client.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/services/math_client/src/math_client.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/services/ping_client/src/ping_client.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -36,7 +36,7 @@ int main(int argc, char **argv)
eCAL::protobuf::CServiceClient<PingService> 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;
Expand Down
4 changes: 2 additions & 2 deletions samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0581cb5

Please sign in to comment.