Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 /// <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);
     }
 }
Esempio n. 3
0
 /// <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));
 }
Esempio n. 4
0
        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");
                }
            }
        }
Esempio n. 5
0
 protected virtual void OnSessionTimeout(EventArgs e)
 {
     SessionTimeout?.Invoke(this, e);
 }
Esempio n. 6
0
 public virtual void SessionTimeout(C context, SessionTimeout mystruct)
 {
 }