Ejemplo n.º 1
0
        internal RConSession TryCreateSession(RConCredentials creds)
        {
            if (VerifyCredentials == null || !VerifyCredentials(creds))
            {
                throw new AuthenticationException("Invalid credentials");
            }

            var session = new RConSession(creds, SessionTimeout);

            if (_sessions.ContainsKey(creds.Name))
            {
                _sessions[creds.Name] = session;
            }
            else
            {
                _sessions.Add(creds.Name, session);
            }

            return(session);
        }
Ejemplo n.º 2
0
        internal RConSession TryCreateSession(RConCredentials creds)
        {
            if (VerifyCredentials == null || !VerifyCredentials(creds)) {
                throw new AuthenticationException("Invalid credentials");
            }

            var session = new RConSession(creds, SessionTimeout);

            if (_sessions.ContainsKey(creds.Name)) {
                _sessions[creds.Name] = session;
            } else {
                _sessions.Add(creds.Name, session);
            }

            return session;
        }