添加实时通信
This commit is contained in:
27
Yi.Framework.Net6/Yi.Framework.WebCore/SignalRHub/MainHub.cs
Normal file
27
Yi.Framework.Net6/Yi.Framework.WebCore/SignalRHub/MainHub.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Yi.Framework.WebCore.SignalRHub
|
||||
{
|
||||
public class MainHub : Hub
|
||||
{
|
||||
public override Task OnConnectedAsync()
|
||||
{
|
||||
return base.OnConnectedAsync();
|
||||
}
|
||||
|
||||
public override Task OnDisconnectedAsync(Exception exception)
|
||||
{
|
||||
return base.OnDisconnectedAsync(exception);
|
||||
}
|
||||
|
||||
public async Task SendAllTest(string test)
|
||||
{
|
||||
await Clients.All.SendAsync("ReceiveAllInfo", test);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user