async grpc CQ loop

40 views
Skip to first unread message

Rajmohan Banavi

unread,
Sep 5, 2018, 3:17:10 PM9/5/18
to grp...@googlegroups.com
Have a single threaded grpc streaming server which alternately checks for events on queue (AsyncNext) and other network events (using select with timeout). On receiving a socket network event, the server needs to send a grpc reply to the client. To send a grpc reply upon receiving some data on socket, how can one get the tag? Any suggestions/pointers appreciated.

Another method suggested is to run select in a separate thread. Any pointers or sample code that I can look at?

Thanks.

Sree Kuchibhotla

unread,
Sep 8, 2018, 11:40:04 AM9/8/18
to rajmoha...@gmail.com, grpc.io
>>To send a grpc reply upon receiving some data on socket, how can one get the tag?

The tag is something (any void pointer) you pass to the API when starting an operation like read or write. The tag in-a-way is the Identifier for the operation you started. AsyncNext just returns the tag that you passed to indicate that the operation completed.

For more details, please see the grpc example at:
--
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+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAJWm%2BfEJs%3Dr-ZChnY0THOLwkwD1qZDEFhpkRV3dfYQP5w73tsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages