示例#1
0
        protected Session(Client <S, A, C> client, A auth, Func <S, IAuthenticationMethod <A> > authMethodFactory)
        {
            if (typeof(S) != this.GetType())
            {
                throw new ArgumentException("Broken type constraints");
            }

            Client           = client;
            this.auth        = auth;
            this.authMethod  = authMethodFactory((S)this);
            this.authSession = new AuthSessionHolder <A>(authMethod, auth);
        }
示例#2
0
 private void resetAuthSessionAsync()
 {
     if ((authMethod.Features() & AuthenticationFeatures.Reconnect) != AuthenticationFeatures.Reconnect)
     {
         authSession.Dispose();
         authSession = null;
     }
     else
     {
         authSession.Reset();
     }
 }