【发布时间】:2018-09-29 03:51:27
【问题描述】:
有人知道 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();
});
【问题讨论】:
标签: c# asp.net-core signalr