20 lines
335 B
Go
20 lines
335 B
Go
|
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)
|
||
|
}
|