示例#1
0
        protected override Task OnReceived(IRequest request, string connectionId, string data)
        {
            if (!Enum.TryParse(data, true, out JobEnum job))
            {
                return(base.OnReceived(request, connectionId, data));
            }

            ConnectionMapping.RemoveById(connectionId);

            ConnectionMapping.Add(job, connectionId);

            Console.WriteLine("Client: " + data);

            return(base.OnReceived(request, connectionId, data));
        }
示例#2
0
        protected override Task OnDisconnected(IRequest request, string connectionId, bool stopCalled)
        {
            ConnectionMapping.RemoveById(connectionId);

            return(base.OnDisconnected(request, connectionId, stopCalled));
        }