Close stops the server and the kontrol client instance.
()
| 39 | |
| 40 | // Close stops the server and the kontrol client instance. |
| 41 | func (k *Kite) Close() { |
| 42 | k.Log.Info("Closing kite...") |
| 43 | |
| 44 | k.kontrol.Lock() |
| 45 | if k.kontrol != nil && k.kontrol.Client != nil { |
| 46 | k.kontrol.Close() |
| 47 | } |
| 48 | k.kontrol.Unlock() |
| 49 | |
| 50 | if k.listener != nil { |
| 51 | k.listener.Close() |
| 52 | k.listener = nil |
| 53 | } |
| 54 | |
| 55 | k.mu.Lock() |
| 56 | cache := k.verifyCache |
| 57 | k.mu.Unlock() |
| 58 | |
| 59 | if cache != nil { |
| 60 | cache.StopGC() |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func (k *Kite) Addr() string { |
| 65 | return net.JoinHostPort(k.Config.IP, strconv.Itoa(k.Config.Port)) |