コード例 #1
0
        public SessionStateStack(Session owner)
        {
            if (owner == null)
                throw new ArgumentNullException("owner", "owner is null.");

            this.owner = owner;

            sessionStates = new Stack<SessionState>();
        }
コード例 #2
0
        private void CreateAndStartInputThreadFor(Session session)
        {
            SessionInputReader inputReader = new SessionInputReader(session);

            lock (sessionInputReaders)
                sessionInputReaders.Add(inputReader);

            inputReader.Disposed += InputReaderDisposed;

            inputReader.Start();
        }
コード例 #3
0
        public SessionInputReader(Session session)
        {
            if (session == null)
                throw new ArgumentNullException("session", "session is null.");

            this.session = session;
            this.inputThread = null;
            this.disposed = false;

            WireUpEvents();
        }
コード例 #4
0
ファイル: Session.cs プロジェクト: welterde/MarcidiaMud
        public static Session Create(IConnection connection, SessionState sessionState, IConnectionWriterFactory connectionWriterFactory, IServiceProvider services)
        {
            if (connection == null)
                throw new ArgumentNullException("connection", "connection is null.");
            if (sessionState == null)
                throw new ArgumentNullException("sessionState", "sessionState is null.");

            Session session =
                new Session(connectionWriterFactory)
                {
                    Connection = connection,
                    Services = services
                };

            session.PushState(sessionState);

            return session;
        }