Lines Matching defs:Address
34 // Address represents a server the client connects to.
37 type Address struct {
38 // Addr is the server address on which a connection will be established.
64 // connected address.
81 Up(addr Address) (down func(error))
82 // Get gets the address of a server for the RPC corresponding to ctx.
83 // i) If it returns a connected address, gRPC internals issues the RPC on the
84 // connection to this address;
85 // ii) If it returns an address on which the connection is under construction
91 // iii) If it returns an address on which the connection does not exist, gRPC
95 // If opts.BlockingWait is true, it should return a connected address or
96 // block if there is no connected address. It should respect the timeout or
98 // RPCs), it should return an address it has notified via Notify(...) immediately
106 Get(ctx context.Context, opts BalancerGetOptions) (addr Address, put func(), err error)
110 // addresses. If the address Balancer notified is not in the existing connected
111 // addresses, gRPC starts to connect the address. If an address in the existing
114 // the Address slice must be the full list of the Addresses which should be connected.
116 Notify() <-chan []Address
150 addr Address
159 addrCh chan []Address // the channel to notify gRPC internals the list of addresses the client should connect to.
160 next int // index of the next address to return for Get()
161 waitCh chan struct{} // the channel to block when there is no connected address available
174 addr := Address{
184 grpclog.Infoln("grpc: The name resolver wanted to add an existing address: ", addr)
205 open := make([]Address, len(rr.addrs))
229 // as the only address available and rr.addrCh stays nil.
230 rr.addrs = append(rr.addrs, &addrInfo{addr: Address{Addr: target}})
238 rr.addrCh = make(chan []Address, 1)
251 func (rr *roundRobin) Up(addr Address) func(error) {
277 func (rr *roundRobin) down(addr Address, err error) {
289 func (rr *roundRobin) Get(ctx context.Context, opts BalancerGetOptions) (addr Address, put func(), err error) {
313 // Has iterated all the possible address but none is connected.
321 err = status.Errorf(codes.Unavailable, "there is no address available")
366 // Has iterated all the possible address but none is connected.
383 func (rr *roundRobin) Notify() <-chan []Address {
409 // returns the only address Up by resetTransport().