19 lines
472 B
C#
19 lines
472 B
C#
using System.Text.Json;
|
|
using RelayServer.Models.Rtc;
|
|
using WebSocketSharp.Server;
|
|
|
|
namespace RelayServer.Services.Rtc;
|
|
|
|
public static class RtcNotificationService
|
|
{
|
|
public static WebSocketServer? Server { get; set; }
|
|
|
|
public static void Broadcast(RtcNotificationMessage message)
|
|
{
|
|
if (Server is null)
|
|
return;
|
|
|
|
var json = JsonSerializer.Serialize(message);
|
|
Server.WebSocketServices["/"]?.Sessions.Broadcast(json);
|
|
}
|
|
} |