Is multiple services equivalent to multiple servers in golang? I am trying to create a client with multiple servers in grpc in golang. Can someone help? I have just started with golang.
On Thursday, 20 April 2017 at 05:00:16 UTC+5:30 [email protected] wrote: > Yes, this should work. > > > On Monday, April 10, 2017 at 10:39:21 PM UTC-7, [email protected] wrote: >> >> I have two services in my .proto file and I wonder if I can serve them on >> the same ip:port: >> >> lis, _ := net.Listen("tcp", ":8000") >> grpcServer := grpc.NewServer() >> pb.RegisterService1Server(grpcServer, &service1Server{}) >> pb.RegisterService2Server(grpcServer, &service2Server{}) >> grpcServer.Serve(lis) >> >> Is this approach ok? >> >> Also (on a client side) I want to use single connection to a server and >> call method defined in both services: >> >> conn, _ := grpc.Dial(serverAddr) >> cli1 := pb.NewService1Client(conn) >> cli2:= pb.NewService2Client(conn) >> >> Would it work? >> >> Thanks a lot. >> > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/21ffb44c-64ce-469e-a7d5-202cfd9edb13n%40googlegroups.com.
