[example] Update RouteGuide example (#36958)

Simple change to stop writing if `ok` is false in `OnWriteDone()`

Closes #36958

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36958 from yashykt:UpdateRouteGuideExample cd5b066350
PiperOrigin-RevId: 644471350
pull/36901/head
Yash Tibrewal 9 months ago committed by Copybara-Service
parent 2e9f5f1e4a
commit 57fb13dfc2
  1. 6
      examples/cpp/route_guide/route_guide_callback_client.cc

@ -243,7 +243,11 @@ class RouteGuideClient {
StartRead(&server_note_);
StartCall();
}
void OnWriteDone(bool /*ok*/) override { NextWrite(); }
void OnWriteDone(bool ok) override {
if (ok) {
NextWrite();
}
}
void OnReadDone(bool ok) override {
if (ok) {
std::cout << "Got message " << server_note_.message() << " at "

Loading…
Cancel
Save