signalr

SignalR send object - newbie

巧了我就是萌 提交于 2020-01-14 10:21:51
问题 With Signal R, if trying to send an object, what is the syntax to pass the model? private async void FormLoaded(object sender, RoutedEventArgs e) { //Connection stuff... Proxy.On("sendHello", () => OnSendDataConnection(ModelBuilder())); } private void OnSendDataConnection(ConnectionModel model) { Dispatcher.Invoke(DispatcherPriority.Normal,model?????) this.Dispatcher.Invoke((Action)(LoadW)); } 回答1: Looking at the question (text, and not the code) I understand you are trying to send Complex

SignalR - Javascript Hub Proxies

♀尐吖头ヾ 提交于 2020-01-14 06:32:23
问题 When you use SignalR, in your HTML you need to reference the following two scripts: <script src="~/Scripts/jquery.signalR-1.0.0.js"></script> <script src="/signalR/hubs"></script> The second one is for a JavaScript hub proxy which will be auto generated. Everything works fine. However what happens if the JavaScript Hub Proxy generation is disabled somehow, perhaps by setting DisableJavaScriptProxies property (https://github.com/SignalR/SignalR/commit/7e974f4e92551a26f3e3e0a166e1dbf6c064e850).

SignalR cross-domain connection - connecting connection Id's with users

此生再无相见时 提交于 2020-01-14 05:57:10
问题 I'm hosting my signalr hub on a separate domain and making cross domain connection to hub from my main application. When a user logs into the main application, signalr connection is established. Now, the problem I'm having is how to identify the connected user inside the hub. If my Hub was within the main application then I could use the Context.User of the logged in user and maintain a dictionary and update them on Connect and Disconnect events. But being a cross-domain connection, I don't

UWP / Xamarin crash in submission tests when I try to upload a microsoft store

我怕爱的太早我们不能终老 提交于 2020-01-14 05:31:10
问题 I am working with Xamarin Forms on a message sending application with SignalR, which I have tested countless times locally and on Android and it works fine without crashes, but when they do the tests to upload it to the microsoft store they report that my application crashes . According to the App center, the application crashes when they trying to send a message through SignalR, this is the error: < SendPrivateMessageAsync> d__46.MoveNext () + 0x14b System.Reflection.MissingMetadataException

SignalR cross domain and IIS 7.5 path to hub only works locally on the server, how to access it externally?

烈酒焚心 提交于 2020-01-14 03:46:25
问题 I am self hosting a SignalR Hubs server within my C# WinForms application: string url = "http://localhost:8081/"; m_signalrServer = new Microsoft.AspNet.SignalR.Hosting.Self.Server(url); // Map the default hub url (/signalr) m_signalrServer.MapHubs(); // Start the SignalRserver m_signalrServer.Start(); My ASP.NET web application is acting as the SignalR Hubs JavaScript client: <script type="text/javascript" src="/Scripts/jquery.signalR-1.0.0-alpha2.min.js"></script> <script type="text

SignalR Connection Blocked Until page images load

天涯浪子 提交于 2020-01-14 03:33:07
问题 this is my signalr hub connection : chat = $.connection.chat; $.connection.hub.start().done(function () { // problem is here // this part is waiting for full page load.! }); why signalr connection waits for my page contents to load complete? i have a <img src='BAD SERVER'/> sometimes take 2 minutes to load successfully. and the connection is waiting for images loaded.! how can i fix this problem ? 回答1: Try this: chat = $.connection.chat; $.connection.hub.start({ waitForPageLoad: false }).done

Calling SignalR service from a BackgroundWorker in ABP

≯℡__Kan透↙ 提交于 2020-01-14 03:21:10
问题 I have a BackgroundWorker which is supposed to broadcast something to all online clients in 5 seconds interval: DeactivationBackgroundWorker: public class DeactivationBackgroundWorker : PeriodicBackgroundWorkerBase, ISingletonDependency { private readonly IRepository<HitchRequest, long> _hitchRequestRepository; private readonly IHitchHub _hitchHub; public DeactivationBackgroundWorker(AbpTimer timer, IRepository<HitchRequest, long> hitchRequestRepository, IHitchHub hitchHub) : base(timer) {

SignalR Broadcast Intercept Using Pipeline Module

人走茶凉 提交于 2020-01-14 02:34:08
问题 I have created a setup where I have a back-end service that is broadcasting messages using SignalR through a SQL backplane and clients are receiving the messages through a MVC 5 + SignalR web application on a web farm. I want to intercept the messages before they get to the client from the web application and make some changes to the message, specifically return HTML to the client instead of the raw data. I have been able to achieve this in a development environment where the messages

AspNetCore.SignalR : Cannot start a connection that is not in the Initial state

北城余情 提交于 2020-01-13 13:05:47
问题 I have troubles to get my ASP.NET Core SignalR app working. I have this server-side code : public class PopcornHub : Hub { private int Users; public async Task BroadcastNumberOfUsers(int nbUser) { await Clients.All.InvokeAsync("OnUserConnected", nbUser); } public override async Task OnConnectedAsync() { Users++; await BroadcastNumberOfUsers(Users); await base.OnConnectedAsync(); } public override async Task OnDisconnectedAsync(Exception exception) { Users--; await BroadcastNumberOfUsers(Users

AspNetCore.SignalR : Cannot start a connection that is not in the Initial state

别说谁变了你拦得住时间么 提交于 2020-01-13 13:05:15
问题 I have troubles to get my ASP.NET Core SignalR app working. I have this server-side code : public class PopcornHub : Hub { private int Users; public async Task BroadcastNumberOfUsers(int nbUser) { await Clients.All.InvokeAsync("OnUserConnected", nbUser); } public override async Task OnConnectedAsync() { Users++; await BroadcastNumberOfUsers(Users); await base.OnConnectedAsync(); } public override async Task OnDisconnectedAsync(Exception exception) { Users--; await BroadcastNumberOfUsers(Users