complete some unfinished error
This commit is contained in:
@ -68,7 +68,7 @@ var (
|
|||||||
// ErrNetworkIP indicates that the connection is down due to some network I/O error.
|
// ErrNetworkIP indicates that the connection is down due to some network I/O error.
|
||||||
ErrNetworkIO = errors.New("grpc: failed with network I/O error")
|
ErrNetworkIO = errors.New("grpc: failed with network I/O error")
|
||||||
// ErrConnDrain indicates that the connection starts to be drained and does not accept any new RPCs.
|
// ErrConnDrain indicates that the connection starts to be drained and does not accept any new RPCs.
|
||||||
ErrConnDrain = errors.New("grpc: ")
|
ErrConnDrain = errors.New("grpc: the connection is drained")
|
||||||
errConnClosing = errors.New("grpc: the addrConn is closing")
|
errConnClosing = errors.New("grpc: the addrConn is closing")
|
||||||
// minimum time to give a connection to complete
|
// minimum time to give a connection to complete
|
||||||
minConnectTimeout = 20 * time.Second
|
minConnectTimeout = 20 * time.Second
|
||||||
@ -121,6 +121,13 @@ func WithNameResolver(r naming.Resolver) DialOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WithBalancer returns a DialOption which sets a load balancer.
|
||||||
|
func WithBalancer(b Balancer) DialOption {
|
||||||
|
return func(o *dialOptions) {
|
||||||
|
o.balancer = b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// WithBackoffMaxDelay configures the dialer to use the provided maximum delay
|
// WithBackoffMaxDelay configures the dialer to use the provided maximum delay
|
||||||
// when backing off after failed connection attempts.
|
// when backing off after failed connection attempts.
|
||||||
func WithBackoffMaxDelay(md time.Duration) DialOption {
|
func WithBackoffMaxDelay(md time.Duration) DialOption {
|
||||||
@ -471,20 +478,6 @@ type addrConn struct {
|
|||||||
transport transport.ClientTransport
|
transport transport.ClientTransport
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
func (ac *addrConn) startDrain() {
|
|
||||||
ac.mu.Lock()
|
|
||||||
t := ac.transport
|
|
||||||
ac.drain = true
|
|
||||||
if ac.down != nil {
|
|
||||||
ac.down(ErrConnDrain)
|
|
||||||
ac.down = nil
|
|
||||||
}
|
|
||||||
ac.mu.Unlock()
|
|
||||||
ac.tearDown(ErrConnDrain)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// printf records an event in ac's event log, unless ac has been closed.
|
// printf records an event in ac's event log, unless ac has been closed.
|
||||||
// REQUIRES ac.mu is held.
|
// REQUIRES ac.mu is held.
|
||||||
func (ac *addrConn) printf(format string, a ...interface{}) {
|
func (ac *addrConn) printf(format string, a ...interface{}) {
|
||||||
|
Reference in New Issue
Block a user