is there any easy-to-understand example for a multithreaded c++ grpc server 
which handles multiple client requests,

regards,
guru

On Wednesday, June 16, 2021 at 10:52:19 PM UTC+5:30 yas...@google.com wrote:

> > However, HandleRpc() only call proceed() once,. It seems we always stay 
> in the PROCESS state. Will it generate the memory leak?
>
> No, the same CallData object is used multiple times as a completion queue 
> tag, allowing the state to progress.
>
> > What does it mean to have cq->next(&tag, &ok) return the out param ok as 
> false? 
>
> A `false` value for `ok` signifies a failure to read a successful event, 
> but the documentation already mentions that. Do you have a more specific 
> question that you have in mind?
> On Sunday, May 30, 2021 at 12:44:25 PM UTC-7 Mohan Gyara wrote:
>
>> What does it mean to have cq->next(&tag, &ok) return the out param ok as 
>> false? 
>> I appreciate if someone answer this. 
>>
>> Regards,
>> Mohan
>>
>> On Thursday, 5 November 2015 at 08:48:33 UTC+5:30 hardy wrote:
>>
>>> Is there anyone familiar with CompleteQueue could tell me how the 
>>> mechanism is? The only piece of codes I can found is 
>>>
>>>   void HandleRpcs() {
>>>     // Spawn a new CallData instance to serve new clients.
>>>     new CallData(&service_, cq_.get());
>>>     void* tag;  // uniquely identifies a request.
>>>     bool ok;
>>>     while (true) {
>>>       // Block waiting to read the next event from the completion 
>>> queue. The
>>>       // event is uniquely identified by its tag, which in this case is 
>>> the
>>>       // memory address of a CallData instance.
>>>       cq_->Next(&tag, &ok);
>>>       GPR_ASSERT(ok);
>>>       static_cast<CallData*>(tag)->Proceed();
>>>     }
>>>   }
>>>
>>>
>>> I really would like to know how I could response to different kinds of 
>>> request? And will the loop keep iterating over the CompleteQueue again and 
>>> again?
>>>
>>>

-- 
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/11f67bb3-5485-4aec-9d59-c0a73d5a2b3dn%40googlegroups.com.

Reply via email to