// reset resets keep alive state
// and sends the state back to the initial state
// of sending full update
reset resets keep alive state
and sends the state back to the initial state
of sending full update
// reset resets keep alive state // and sends the state back to the initial state // of sending full update
func (h *Heartbeat) reset(state KeepAliveState) {
	h.setState(state)
	h.nextAnnounce = time.Time{}
	h.nextKeepAlive = time.Time{}
	h.keepAlive = nil
	if h.keepAliver != nil {
		if err := h.keepAliver.Close(); err != nil {
			h.Warningf("Failed to close keep aliver: %v", err)
		}
		h.keepAliver = nil
	}
}
func ( h * Heartbeat ) reset ( state KeepAliveState ) { h . setState ( state ) h . nextAnnounce = time . Time { } h . nextKeepAlive = time . Time { } h . keepAlive = nil if h . keepAliver != nil { if err := h . keepAliver . Close ( ) ; err != nil { h . Warningf ( " " , err ) } h . keepAliver = nil } }
reset resets keep alive state
and sends the state back to the initial state
of sending full update
reset resets keep alive state and sends the state back to the initial state of sending full update