示例#1
0
        public IHttpActionResult SignalrRegister(string connectionId)
        {
            var ctx = GlobalHost.ConnectionManager.GetHubContext <NotificationHub>();

            _signalRCache.AddConnectionId(GetRequesterId(), connectionId);

            //ctx.Clients.Client(connectionId).albumRequest(connectionId + GetRequesterId());

            return(Ok());
        }
        public override Task OnConnected()
        {
            var id           = GetRequesterId();
            var connectionId = Context.ConnectionId;

            _signalRCache.AddConnectionId(id, connectionId);

            Clients.Caller.albumRequest("Message importante");

            return(base.OnConnected());
        }