If the server returns an error status, the read/write calls on the client 
side will fail and the status can be obtained via Finish.
I do not think there is another way to do it.


On Monday, May 13, 2019 at 7:16:47 AM UTC-7, [email protected] wrote:
>
>
> Hi,
> I have gRPC server with bidirectional method, that receive some numbers in 
> stream and the server streams some numbers back, totally async.
> But if the number is not good (for some reason), the server that written 
> in java invokes the observer.onError().
>
> I have client implemented in Java for that server, and when the server 
> raise error in catchs in the client receiver observer on the onError() and 
> everything is fine.
> Now I want to write C++ implementation of this client but something is 
> different. In C++ there is no way to register for error events, I could get 
> the error only after I invoke the stream->Finish(), but it's not good for 
> me because we are talking about long living streams, unbounded. I can't 
> wait for the finish to get the error - I must know when the server raised 
> an error WHILE I send the numbers from client to server.
>
> In other words, what is the equivalent of java SessionObserver.onError() 
> in C++? How can I be notified when the server raise onError()?
>

-- 
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/e9b7d4dc-03e0-478a-800f-a6707aa1776b%40googlegroups.com.

Reply via email to