xref: /aosp_15_r20/external/grpc-grpc/examples/cpp/cancellation/README.md (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1# Cancellation Example
2
3## Overview
4
5This example shows you how to cancel from the client and how to get informed on the server and the client.
6
7### Try it!
8
9Once you have working gRPC, you can build this example using either bazel or cmake.
10
11Run the server, which will listen on port 50051:
12
13```sh
14$ ./server
15```
16
17Run the client (in a different terminal):
18
19```sh
20$ ./client
21```
22
23If things go smoothly, you will see the client output:
24
25```
26Begin : Begin Ack
27Count 1 : Count 1 Ack
28Count 2 : Count 2 Ack
29Count 3 : Count 3 Ack
30Count 4 : Count 4 Ack
31Count 5 : Count 5 Ack
32Count 6 : Count 6 Ack
33Count 7 : Count 7 Ack
34Count 8 : Count 8 Ack
35Count 9 : Count 9 Ack
36RPC Cancelled!
37```
38