12345678910111213141516171819202122232425262728 |
- package main
- import (
- "cfTest/curl"
- "cfTest/server"
- "google.golang.org/grpc"
- "log"
- "net"
- )
- const (
- curlPort = ":50053"
- )
- func main() {
- lis, err := net.Listen("tcp", curlPort)
- if err != nil {
- log.Fatalf("failed to listen: %v", err)
- }
- s := grpc.NewServer()
- curl.RegisterCurlWithResolveServer(s, &server.CurlServer{})
- log.Printf("server listening at %v", lis.Addr())
- if err := s.Serve(lis); err != nil {
- log.Fatalf("failed to serve: %v", err)
- }
- }
|