mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
16 lines
422 B
C#
16 lines
422 B
C#
using Microsoft.AspNetCore.SignalR;
|
|
|
|
public class SignalRHub : Hub
|
|
{
|
|
public async Task SendMessage(string user, string message)
|
|
{
|
|
await Clients.All.SendAsync("ReceiveMessage", user, message);
|
|
}
|
|
public override Task OnConnectedAsync()
|
|
{
|
|
var connectionId = Context.ConnectionId;
|
|
// Store the connection ID for later use, e.g., in a database or in-memory store
|
|
return base.OnConnectedAsync();
|
|
}
|
|
}
|