|
|
@ -2,7 +2,6 @@ package downloader |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"log" |
|
|
|
"log" |
|
|
|
"net" |
|
|
|
"net" |
|
|
|
|
|
|
|
|
|
|
@ -31,7 +30,9 @@ func (s *Server) Query(ctx context.Context, request *pb.DownloaderRequest) (*pb. |
|
|
|
|
|
|
|
|
|
|
|
// Start starts the Server on given ip and port.
|
|
|
|
// Start starts the Server on given ip and port.
|
|
|
|
func (s *Server) Start(ip, port string) (*grpc.Server, error) { |
|
|
|
func (s *Server) Start(ip, port string) (*grpc.Server, error) { |
|
|
|
lis, err := net.Listen("tcp", fmt.Sprintf("%s:%s", ip, port)) |
|
|
|
// TODO(minhdoan): Currently not using ip. Fix it later.
|
|
|
|
|
|
|
|
addr := net.JoinHostPort("", port) |
|
|
|
|
|
|
|
lis, err := net.Listen("tcp", addr) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Fatalf("failed to listen: %v", err) |
|
|
|
log.Fatalf("failed to listen: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|