MCPcopy
hub / github.com/grpc/grpc-go / Dialer

Method Dialer

benchmark/latency/latency.go:277–288  ·  view source on GitHub ↗

Dialer returns a Dialer that wraps d and injects n's latency in its connections. n's Latency is also injected to the connection's creation.

(d Dialer)

Source from the content-addressed store, hash-verified

275// Dialer returns a Dialer that wraps d and injects n's latency in its
276// connections. n's Latency is also injected to the connection's creation.
277func (n *Network) Dialer(d Dialer) Dialer {
278 if n.isLocal() {
279 return d
280 }
281 return func(network, address string) (net.Conn, error) {
282 conn, err := d(network, address)
283 if err != nil {
284 return nil, err
285 }
286 return n.Conn(conn)
287 }
288}
289
290// TimeoutDialer returns a TimeoutDialer that wraps d and injects n's latency
291// in its connections. n's Latency is also injected to the connection's

Callers

nothing calls this directly

Calls 2

isLocalMethod · 0.95
ConnMethod · 0.95

Tested by

no test coverage detected