1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| using Furion.InstantMessaging;
| using Microsoft.AspNetCore.SignalR;
|
| namespace IStation.Application
| {
| /// <summary>
| /// 聊天集线器
| /// </summary>
| [MapHub("/hubs/chathub")]
| public class ChatHub : Hub
| {
| /// <summary>
| /// 定义一个方法供客户端调用
| /// </summary>
| public Task SendMessage(string user, string message)
| {
| // 触发客户端定义监听的方法
| return Clients.Others.SendAsync("ReceiveMessage", user, message);
| }
| }
| }
|
|