I am using the code from this async example: 
https://github.com/grpc/grpc/blob/v1.32.0/examples/cpp/helloworld/greeter_async_server.cc

I've made a research and it seems that you can directly catch when a client 
has been disconnected by any reason. However you can tell that client has 
been disconnected by turning the feature KeepAlive.

So I added the following lines on the server:

*builder.AddListeningPort(server_address, 
grpc::InsecureServerCredentials()); 
builder.AddChannelArgument(GRPC_ARG_KEEPALIVE_TIME_MS, 2000); 
builder.AddChannelArgument(GRPC_ARG_KEEPALIVE_TIMEOUT_MS, 3000); 
builder.AddChannelArgument(GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS, 1);*

However how can I now detect the disconnect? Just by adding those there is 
no way to catch the disconnect. There is no example about such scenario. 
Where should I listen? on `ServerContext` or where and how to exactly 
detect it ?

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/d4687a3e-0549-473b-be38-214328c25ea6n%40googlegroups.com.

Reply via email to