modified version of https://github.com/grpc/grpc-go/tree/master/examples/helloworld
Follow these steps (Linux only):
-
Run the server:
$ go run ./greeter_client
-
Run the client in a new terminal window:
export GODEBUG=http2debug=2 go run ./greeter_client -name=no_reconnect
-
Run the client in a new terminal window:
export GODEBUG=http2debug=2 go run ./greeter_client -name=reconnect -alive
-
In yet another terminal window:
sudo netstat -anp | grep greeter_c # use port from here in the line below sudo iptables -I INPUT -p tcp --dport <<PORT>> -j DROP
-
Observe the behavior in the two client terminals
- reconnect client will have a single timeout, then reconnect
- no_reconnect client will have repeated timeouts