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 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/1a24b65b-4a11-4157-a4f3-8b19ff8840ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to