DialTimeout acts like Dial but takes a timeout.
(timeout time.Duration)
| 238 | |
| 239 | // DialTimeout acts like Dial but takes a timeout. |
| 240 | func (c *Client) DialTimeout(timeout time.Duration) error { |
| 241 | err := c.dial(timeout) |
| 242 | |
| 243 | c.LocalKite.Log.Debug("Dialing '%s' kite: %s (error: %v)", c.Kite.Name, c.URL, err) |
| 244 | |
| 245 | if err != nil { |
| 246 | return err |
| 247 | } |
| 248 | |
| 249 | go c.run() |
| 250 | |
| 251 | return nil |
| 252 | } |
| 253 | |
| 254 | // Dial connects to the remote Kite. If it can't connect, it retries |
| 255 | // indefinitely. It returns a channel to check if it's connected or not. |