SignalR记录
服務(wù)端檢索數(shù)據(jù)庫,有跟新,推送給客戶端
1: GlobalHost.ConnectionManager.GetHubContext<tvHub>().Clients.Client(Client.Key).sendMessage(UserHandler.dicGoods[roomid]);?winform或者其他 加載nuget包?public class tvDataShow{private IHubProxy HubProxy { get; set; }private HubConnection Connection { get; set; }public void SendMessage(string roomId,List<tvModel> data){HubProxy.Invoke("sendMessage", roomId, data);}public void controllerConnected(string roomId){HubProxy.Invoke("controllerConnected", roomId);}/// <summary>/// Creates and connects the hub connection and hub proxy. This method/// is called asynchronously from SignInButton_Click./// </summary>public async void ConnectAsync(string ServerURI){Connection = new HubConnection(ServerURI);HubProxy = Connection.CreateHubProxy("tvHub");try{await Connection.Start();}catch (HttpRequestException){return;}}}轉(zhuǎn)載于:https://www.cnblogs.com/GarsonZhang/p/5355436.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
- 上一篇: SNAT,是源地址转换,其作用是将ip数
- 下一篇: hashCode()方法的性能优化