HI,

I actually have the same question. Did you figure this out?

Malek

On Friday, October 9, 2020 at 12:50:37 AM UTC-7 guru pucu wrote:

> Hi,
>
> I'm exploring a way to let client side send streaming request to server 
> (async call with cq). From the server side I got a ServerAsyncReader<W, R> 
> object, which has a read function to read the request stream. However, the 
> function confuses me and I couldn't find any answer to my Q from the 
> document.
>
> When I tested the function, it looks like it is a non-blocking call, which 
> means the server will not wait for client to write to request stream if 
> there's nothing to read. However, the function has no return value. So, 
> what would I get if there's nothing to read? From the doc the cq 
> notification means the read completes, but does not mean there's more 
> request to read. How do the server know many times it should read from the 
> input stream, and what happens if it reads more / faster than the client 
> writes?
>
> Another issue I keep hitting is, the code keeps crashing when calling next 
> on cq. In my code I make the server to pause after receiving the rpc call, 
> wait until the client calls writesdone on ClientAsyncWriter, then start 
> reading from the ServerAsyncReader object. However, the request read from 
> ServerAsyncReader is always garbage, and the code crash right after I call 
> next on the cq.
>
> I searched around but couldn't find any useful sample code / flow chart 
> about how the client / server work in such setup. Is there any document 
> about how to use this class?
>
> Thank you.
>

-- 
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/b5220a5e-fea7-4c96-8f3b-6097c3c9b32fn%40googlegroups.com.

Reply via email to