go-rpc/main.go

20 lines
335 B
Go
Raw Normal View History

2020-10-03 12:40:19 +02:00
package main
import (
"net"
"go-rpc/rpc_node"
"google.golang.org/grpc"
)
func mani() {
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port))
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
grpcServer := grpc.NewServer()
pb.RegisterRouteGuideServer(grpcServer, &routeGuideServer{})
grpcServer.Serve(lis)
}