There are a number of reasons why the stream might be closed.  The server 
might close the individual stream, or the underlying connection as a whole 
might be dropped, which will implicitly close all streams active at the 
moment when the connection is dropped.  When stream->Read() returns false, 
you should call stream->Finish() to get the RPC's status, and the status 
message should tell you why the stream failed.

If the problem is that the stream failed because the underlying connection 
was closed because of idleness, then keepalive might be a good way to 
address that.  The keepalive knobs are documented at 
https://github.com/grpc/grpc/blob/master/doc/keepalive.md.  
GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS is probably not the knob you want, 
because in this case, you do have an active call (note: "call" and "stream" 
are the same thing in this context).  I think you would just need to 
set GRPC_ARG_KEEPALIVE_TIME_MS.

I hope this info is helpful.

On Wednesday, January 12, 2022 at 10:18:55 PM UTC-8 Roshan Chaudhari wrote:

> I have bidirectional streaming rpc between server and client. If data is 
> not exchanged over the stream, after certain time, on the server, it seems 
> that stream is disconnected or stream-Read() returns false.
>
> Currently I am not using keepalive flags for the channel on server and 
> client
> *. *
> There is a flag:
> GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS
> : This channel argument if set to 1 (0 : false; 1 : true), allows 
> keepalive pings to be sent even if there are no calls in flight.
> what is meaning of "no calls in flight" ?
>
> Is this the option will help me out to solve my issue?
>
>
> -
> Roshan
>

-- 
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/ba2fc13e-b6fc-49dc-855e-10b86c3fa784n%40googlegroups.com.

Reply via email to