SignalR working?
This commit is contained in:
21
WD7UVN_HFT_2023241.Endpoint/Services/SignalRHub.cs
Normal file
21
WD7UVN_HFT_2023241.Endpoint/Services/SignalRHub.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace WD7UVN_HFT_2023241.Endpoint.Services
|
||||
{
|
||||
public class SignalRHub : Hub
|
||||
{
|
||||
public override Task OnConnectedAsync()
|
||||
{
|
||||
Clients.Caller.SendAsync("Connected", Context.ConnectionId);
|
||||
return base.OnConnectedAsync();
|
||||
}
|
||||
|
||||
public override Task OnDisconnectedAsync(Exception exception)
|
||||
{
|
||||
Clients.Caller.SendAsync("Disconnected", Context.ConnectionId);
|
||||
return base.OnDisconnectedAsync(exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user