private void DisposeHeartbeatTimer() { if (heartbeatTimer == null) return; try { heartbeatTimer.Dispose(); } catch (Exception ex) { if (this.OnError != null) this.OnError(ex); } heartbeatTimer = null; }