Skip to content

Commit

Permalink
Merge 7cfbc75 into a93722c
Browse files Browse the repository at this point in the history
  • Loading branch information
caguero authored Mar 31, 2021
2 parents a93722c + 7cfbc75 commit f7fe4a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions example/requester_oneway.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ int main(int argc, char **argv)

if (!executed)
std::cerr << "Service call failed" << std::endl;

std::cout << "Press <CTRL-C> to exit" << std::endl;

// Zzzzzz.
ignition::transport::waitForShutdown();
}
13 changes: 10 additions & 3 deletions tutorials/05_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ int main(int argc, char **argv)
if (!executed)
std::cerr << "Service call failed" << std::endl;
std::cout << "Press <CTRL-C> to exit" << std::endl;
// Zzzzzz.
ignition::transport::waitForShutdown();
}
```

Expand Down Expand Up @@ -440,7 +445,9 @@ provider of the service ``/oneway``. Ignition Transport will find a node and
communicate the data without waiting for the response. The return value of
``Request()`` indicates if the request was successfully queued. Note that this
variant of ``Request()`` is also asynchronous, so your code will not block while
your service request is handled.
your service request is handled. In this example, we also call
`waitForShutdown()` to minimize the risk of terminating the program before the
request was already published.

## Service without input parameter

Expand Down Expand Up @@ -576,8 +583,8 @@ file within the ``ign_transport_tutorial`` folder.
## Building the code

Download the [CMakeLists.txt](https://github.com/ignitionrobotics/ign-transport/raw/main/example/CMakeLists.txt) file
within the ``ign_transport_tutorial`` folder. Then, download
[CMakeLists.txt](https://github.com/ignitionrobotics/ign-transport/raw/main/example/msgs/CMakeLists.txt) and [stringmsg.proto](https://github.com/ignitionrobotics/ign-transport/raw/main/example/msgs/stringmsg.proto) inside the
within the ``ign_transport_tutorial`` folder. Then, create a `msgs` directory
and download [CMakeLists.txt](https://github.com/ignitionrobotics/ign-transport/raw/main/example/msgs/CMakeLists.txt) and [stringmsg.proto](https://github.com/ignitionrobotics/ign-transport/raw/main/example/msgs/stringmsg.proto) inside the
``msgs`` directory.

Once you have all your files, go ahead and create a ``build/`` folder within
Expand Down

0 comments on commit f7fe4a7

Please sign in to comment.