... | @@ -140,6 +140,13 @@ The requester is created by connecting to the responder named "the-responder" li |
... | @@ -140,6 +140,13 @@ The requester is created by connecting to the responder named "the-responder" li |
|
|
|
|
|
The requester application can terminate unexpectedly whereas the responder is responding to it. In that case the responder may block indefinitely. That is why it is possible to set a timeout in milliseconds:
|
|
The requester application can terminate unexpectedly whereas the responder is responding to it. In that case the responder may block indefinitely. That is why it is possible to set a timeout in milliseconds:
|
|
```cpp
|
|
```cpp
|
|
|
|
// Set the request timeout with 1s.
|
|
request->setTimeout(1000);
|
|
request->setTimeout(1000);
|
|
```
|
|
|
|
|
|
|
|
|
|
// Reply a string to the requester.
|
|
|
|
bool res = request->reply("Done");
|
|
|
|
if (!res) {
|
|
|
|
std::cout << "Timeout occurred" << std::endl;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
This timeout can be set in Java and Python with the same method and function. |