一、asp.net core使用signalR入门

1,nuget Microsoft.AspNetCore.SignalR 

2,新建ChatHub文件

using Microsoft.AspNetCore.SignalR;
using System.Threading.Tasks;
namespace SignalRDemo
{
    public class ChatHub:Hub
    {
        public async Task SendMessage(string user,string message)
        {
            await Clients.All.SendAsync("ReceiveMessage",user,message);
        }
        
    }
}
ChatHub

相关文章:

  • 2019-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2019-09-17
  • 2021-10-13
  • 2021-10-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2022-01-26
  • 2022-12-23
  • 2017-11-24
  • 2019-09-18
相关资源
相似解决方案