func (client *Client) Close() error { var err golib.MultiError client.pausedCond.L.Lock() defer client.pausedCond.L.Unlock() err.Add(client.Client.Close()) client.resume(false) err.Add(client.lastErr) return err.NilOrError() }
func (detector *HeartbeatFaultDetector) Close() error { var err golib.MultiError detector.Closed.Enable(func() { delete(detector.server.detectors, detector.token) // Notify remote server to stop sending heartbeats. if detector.Online() { err.Add(detector.client.ConfigureHeartbeat(detector.server.Server, 0, 0)) } err.Add(detector.client.Close()) }) return err.NilOrError() }
func (session *udpSession) Cleanup() { var errors golib.MultiError if session.udp.Err != nil { errors.Add(fmt.Errorf("UDP proxy %v error: %v", session.udp, session.udp.Err)) } if session.udp2 != nil && session.udp2.Err != nil { errors.Add(fmt.Errorf("UDP proxy %v error: %v", session.udp2, session.udp2.Err)) } session.CleanupErr = errors.NilOrError() if session.proxy.ProxyStoppedCallback != nil { session.proxy.ProxyStoppedCallback(session.udp) if session.udp2 != nil { session.proxy.ProxyStoppedCallback(session.udp2) } } }
func (breaker *circuitBreaker) Close() error { var err golib.MultiError err.Add(breaker.client.Close()) err.Add(breaker.FaultDetector.Close()) return err.NilOrError() }