I would suggest, based on your description, that you might just want 
multiple methods in the same service (which you can do by just declaring 
multiple different rpc entries in your .proto file). If you need multiple 
services, though, you can do that just by registering each service one 
after another. There are examples of this in 
test/cpp/end2end/hybrid_end2end_test.cc

To know which service call is made, remember that you have to register your 
calls ahead of time at the server. You can see this in the RequestSayHello 
line of the example. The last argument of that function is the "tag" that 
will get posted on the completion queue when this requested method is 
actually called. So, you will know which method it is by making sure to 
always post a unique tag for each method call that you are registering at 
the server.

Regards,
Vijay

On Thursday, January 19, 2017 at 10:09:16 AM UTC-8, AK wrote:
>
> I know there is an example helloworld program in gRPC source. However, 
> being new to this, I don't understand how to write more than one async 
> services in the server. The example here 
> <https://github.com/grpc/grpc/blob/v1.0.0/examples/cpp/helloworld/greeter_async_server.cc>
>  
> talks about spawning new instances of a class to handle SayHello service 
> calls.
>
>    1. How to add new services, for example SayBye, so that I can make 
>    calls to it from client?
>    2. How to make the server identify which service call was made by the 
>    client ?
>
>

-- 
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 post to this group, send email to [email protected].
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/4ad41ecb-13d2-4e4d-a4d0-032eff2dab14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to