有人知道 AspNet SignalR 中这段代码的等效 AspNetCore SignalR 吗?
Task.Factory.StartNew(() =>
{
//// var clients = Hub.Clients<RealTimeNotificationHub>();
var connection = new HubConnectionContext("https://demohouse.go.ro:96/");
var notificationmessag = new AlertMessage();
notificationmessag.Content = "New message from " + device.Name + " <b>" +
text + " </b>";
notificationmessag.Title = alertType.Name;
var myHub = connection.CreateHubProxy("realTimeNotificationHub");
connection.Start().Wait();
object[] myData = { notificationmessag.Title, notificationmessag.Content };
myHub.Invoke("sendMessage", myData).Wait();
connection.Stop();
});
Run Code Online (Sandbox Code Playgroud)