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); }
private void resetAuthSessionAsync() { if ((authMethod.Features() & AuthenticationFeatures.Reconnect) != AuthenticationFeatures.Reconnect) { authSession.Dispose(); authSession = null; } else { authSession.Reset(); } }