My understanding is that you register the service with a host string to match a client using the corresponding authority for example
registerService("other_service.myapi.com", service) and the client to use client_context.set_authority("other_service.myapi.com"); and then makes the rpc. At the server side, grpc library will first try to find an exact match of the :authority header on the wire with the registered services. If it cannot find any it will try to just look for the method name with the registered services. On Tuesday, March 20, 2018 at 8:08:34 PM UTC-7, ant...@modbot.com wrote: > > Hello, > > I'm looking to register multiple services to the same (sync) server in > C++, ideally specifying a different IP / port for each. > The ServerBuilder documentation suggests that I'm able to specify a host > along with the service I'm registering to the server, a la > > builder.registerService(host_string, &service) > > However, when I provide a host string in the format "[ip]:[port]" (or a > more concrete ex; `0.0.0.0:50051`), no clients are able to successfully > make RPCs to the server, calls which would otherwise work if I simply > registered to the default host using registerService([service addr]). > Providing an IP without port and vice versa don't work either. The > documentation doesn't elaborate on the format the function expects for the > function param std::string host. What should I be providing here? > > Cheers, > Antonia > > -- 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 post to this group, send email to email@example.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/aaa1b689-b9f0-4730-9608-7a3ccfb715ac%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.