Thanks Mark for responding.! 

On client side, I did not receive a notification that server/stream closed. 
On server, after Read()->false, context_->IsCancelled() is true. Also, I 
have seen this client running on windows and server on linux. When I 
checked client as well on Linux, it did not reproduce.

There is a default value for GRPC_ARG_KEEPALIVE_TIME_MS = 2 hours. So that 
means if my bidi stream/session is not explicitly terminated by any parties 
and assuming connection is active, server should not be closed by any 
reason. 

On Thursday, January 20, 2022 at 3:49:09 AM UTC+5:30 Mark D. Roth wrote:

> 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 grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/90cc24c8-ebc7-4ed8-a6bd-51fc005cd612n%40googlegroups.com.

Reply via email to