Exemple #1
0
        public void Start()
        {
            IsRunningValue.Update
            (
                b =>
            {
                if (b)
                {
                    throw new InvalidOperationException();
                }
                return(true);
            }
            );

            try
            {
                Context.RemoteEndPoint = RemoteEndPoint;

                Server.ServerContext.RegisterSession(Context);
                Server.SessionMappings.DoAction(Mappings => Mappings.Add(Context, this));

                if (Server.ServerContext.EnableLogSystem)
                {
                    Server.ServerContext.RaiseSessionLog(new SessionLogEntry {
                        Token = Context.SessionTokenString, RemoteEndPoint = RemoteEndPoint, Time = DateTime.UtcNow, Type = "Sys", Name = "SessionEnter", Message = ""
                    });
                }
                ssm.Start();
            }
            catch (Exception ex)
            {
                OnCriticalError(ex, new StackTrace(true));
                ssm.NotifyFailure();
            }
        }