add dialer for connector

This commit is contained in:
ginuerzh
2022-09-08 22:39:17 +08:00
parent c546a6b711
commit e7a104651a
4 changed files with 31 additions and 4 deletions

View File

@ -71,7 +71,9 @@ func (r *route) Dial(ctx context.Context, network, address string, opts ...DialO
cc, err := r.GetNode(r.Len()-1).transport.Connect(ctx, conn, network, address)
if err != nil {
conn.Close()
if conn != nil {
conn.Close()
}
return nil, err
}
return cc, nil