示例#1
0
 public Task SendMsg(ChatMessageInfo info)
 {
     for (int i = 0; i < 10; i++)
     {
         Clients.Client(Context.ConnectionId).SendAsync("Show", info.DeviceID + ":" + info.Message);
     }
     return(Clients.Client(Context.ConnectionId).SendAsync("Show", info.DeviceID + ":" + info.Message));
 }
示例#2
0
 //SendMsg用于前端调用
 public Task SendAllMsg(ChatMessageInfo info)
 {
     //在客户端实现此处的Show方法
     return(Clients.All.SendAsync("Show", info.DeviceID + ":" + info.Message));
 }