Hi I am writing a server-streaming RPC in java, and trying to figure out 
how to get a signal on client side when the server crashes, so that 
dangling streams can be cleaned-up on client side.

Here is the service definition 
*service MyService {*
*  rpc Get(GetRequest) returns (stream GetResponse) {}*
*}*

Here is the client side code I tried 
*public void get() {*
*   try {*

*        var iter = blockingStub.serverSideStreaming...(request);        
while(iter.hasNext()) {*
*             GetResponse resp = iter.next();*



*        }    } catch (StatusRuntimeException e) {        logInfo("RPC 
failed: {0}", e.getStatus());    }*
*}*

It's observed in test that the client doesn't always get an exception when 
the server is killed. When server is killed, the client get an exception *only 
when the server has sent a message via the stream before. *Is this working 
as intended from gPRC perspective?

What's the recommended way to get a signal on client side when the server 
is killed? Thanks!

-- 
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/d31e790a-a659-4293-a628-17f35d3a76aan%40googlegroups.com.

Reply via email to