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 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/a8c65d97-a4ad-43ec-90ed-104a05e2248d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to