If we examine the code in here
|
func ListenAndServe(addr, cert, key string, opts ...grpc.ServerOption) error { |
|
ln, err := net.Listen("tcp", addr) |
|
if err != nil { |
|
return err |
|
} |
|
srv, err := NewServer(cert, key, opts...) |
|
if err != nil { |
|
return err |
|
} |
|
return srv.Serve(ln) |
we notice that after we invoke net.Listen there is a listener in there that'll be bound to an address, but if any error occurs it won't be released at all
If we examine the code in here
tm-db/remotedb/grpcdb/server.go
Lines 19 to 28 in b3c748f
we notice that after we invoke net.Listen there is a listener in there that'll be bound to an address, but if any error occurs it won't be released at all