DialContext connects to the address on the named network using the provided context. The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection. When
(ctx context.Context, network string, address string)
| 110 | // 1 minute, the connect to each single address will be given 15 seconds to |
| 111 | // complete before trying the next one. |
| 112 | func (d *Dialer) DialContext(ctx context.Context, network string, address string) (*Conn, error) { |
| 113 | return d.connect( |
| 114 | ctx, |
| 115 | network, |
| 116 | address, |
| 117 | ConnConfig{ |
| 118 | ClientID: d.ClientID, |
| 119 | TransactionalID: d.TransactionalID, |
| 120 | }, |
| 121 | ) |
| 122 | } |
| 123 | |
| 124 | // DialLeader opens a connection to the leader of the partition for a given |
| 125 | // topic. |