Beispiel #1
0
        public override Task OnConnected()
        {
            ApplicationRole.TryParse(Context.QueryString["ApplicationRole"], out ApplicationRole appRole);
            switch (appRole)
            {
            case ApplicationRole.Client:
                clientMapper.Add(Context.QueryString["userName"], Context.ConnectionId);
                Clients.Group(AdminGroup).ClientConnected(Context.QueryString["userName"]);
                break;

            case ApplicationRole.Server:
                Groups.Add(Context.ConnectionId, AdminGroup);
                break;
            }

            return(base.OnConnected());
        }