public override async void DidInvalidate(NFCNdefReaderSession session, NSError error) { System.Diagnostics.Debug.WriteLine($"========> DidInvalidate {error}"); await DisableSessionAsync(); if ((NFCReaderError)(long)error.Code == NFCReaderError.ReaderSessionInvalidationErrorSessionTimeout) { SessionTimeout?.Invoke(this, EventArgs.Empty); } }
/// <inheritdoc /> public override int GetHashCode() { unchecked { int hashCode = base.GetHashCode(); hashCode = (hashCode * 397) ^ SessionTimeout.GetHashCode(); hashCode = (hashCode * 397) ^ RebalanceTimeout.GetHashCode(); hashCode = (hashCode * 397) ^ (GroupProtocols?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (GroupId?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (MemberId?.GetHashCode() ?? 0); return(hashCode); } }
/// <inheritdoc /> public bool Equals(JoinGroupRequest other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(base.Equals(other) && SessionTimeout.Equals(other.SessionTimeout) && RebalanceTimeout.Equals(other.RebalanceTimeout) && string.Equals(GroupId, other.GroupId) && string.Equals(MemberId, other.MemberId) && GroupProtocols.HasEqualElementsInOrder(other.GroupProtocols)); }
protected void OnSessionTimeout(object ticks) { _watchdogTimer?.Change(-1, -1); lock (this) { var startTicks = ticks; TimeSpan elapsedTime = (startTicks != null) ? TimeSpan.FromTicks(DateTime.Now.Ticks - (long)startTicks) : TimeSpan.Zero; SessionTimeout?.Invoke(this, new SessionTimeoutEventArgs(elapsedTime)); if (Phase != SessionPhase.Terminate) { //OnSessionClosed("Sesión cerrada para restablecer sesión automáticamente."); OnSessionStarted(); BeginHandshake(); } else if (IsPortReady) { ClosePort(); OnSessionClosed($"No se puedo enviar la petición de cierre de sesión a causa de Timeout. Tiempo sin comunicación {elapsedTime.TotalSeconds} segundos"); } } }
protected virtual void OnSessionTimeout(EventArgs e) { SessionTimeout?.Invoke(this, e); }
public virtual void SessionTimeout(C context, SessionTimeout mystruct) { }