signalr

'System.AggregateException' occurred in mscorlib.dll” when using SignalR

拟墨画扇 提交于 2019-12-08 15:32:01
问题 Consider the following code: using Microsoft.AspNet.SignalR.Client; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Stock { public string Symbol { get; set; } public decimal Price { get; set; } } class Program { static void Main(string[] args) { var hubConnection = new HubConnection("http://www.contoso.com/"); IHubProxy stockTickerHubProxy = hubConnection.CreateHubProxy("StockTickerHub");

Using SignalR server from Python code

倖福魔咒の 提交于 2019-12-08 15:05:30
问题 What are my options for integrating Python with SignalR? The Python code is a part of large 3rd party product, not a matter of language preference. SignalR server provides subscriptions to existing .NET products. We would like to reuse .NET SignalR server with Python. 回答1: I can think of a few ways and they are all theoretical (and probably bad ideas to begin with): IPC - host the python app and the signalr app as different processes and somehow pipe information back and forth using some kind

SignalR - OnDisconnected is called too late

蹲街弑〆低调 提交于 2019-12-08 14:04:09
问题 I'm having a self hosted SignalR 2.2.0 server and using OWIN for the configuration. [assembly: OwinStartup(typeof(Server.Communication.StartUp))] namespace Server.Communication { public class StartUp { public void Configuration(IAppBuilder app) { app.Map("/Communication", map => { map.UseCors(CorsOptions.AllowAll); var hubConfiguration = new HubConfiguration { EnableDetailedErrors = true}; map.RunSignalR(hubConfiguration); }); } } } Im starting the server via WebApp.Start($"http://{ip}:{port}

SignalR: Sometimes Negotiating requests returns 404 error (Load-balanced)

白昼怎懂夜的黑 提交于 2019-12-08 13:31:06
问题 I am using signalR 2.1.2 and I am pushing notifications to my client. The front end is load balanced. The weird thing is: Sometimes it works and sometimes it doesn't. It seems that it doesn't have anything to do with the type of browser. Sometimes it works in IE sometimes it works in Chrome. First I thought that the type of transport might be the problem, that's why I downgraded the transport type to long polling, unfortunately it didn't help: Client Side: $.connection.hub.logging = true; //

IM using SignalR

家住魔仙堡 提交于 2019-12-08 13:30:54
问题 Is it possible to create a facebook like kind of chat using signalr? I've seen a few samples but they are all chat rooms. I want to implement a private chat in my site and was wondering if it'd be possible using signalr. 回答1: Take a look at MessengR https://github.com/davidfowl/MessengR, it's a sample IM thick client using signalr. 回答2: You could also use the tutorial how to build signalr web chat client http://visualstudiomagazine.com/articles/2013/01/22/build-a-signal-r-app-part-1.aspx but

Signalr Owin simple example javascript client not being called

断了今生、忘了曾经 提交于 2019-12-08 12:42:07
问题 I have a 5.3.0 version of signalr self hosting that is being upgraded to a newer version of signalr. Using https://github.com/SignalR/SignalR/wiki/Self-host example i have created a simple example, but i can’t get it to work. I can get a connection to the hub on the server and call methods on the hub, but i can’t get the hub to call the javascript client. When looking at it in fiddler I never see a response come back from the hub. Here is the code using System; using Microsoft.AspNet.SignalR;

SignalR: Connection must be started before data can be sent. Call .start() before .send()

谁都会走 提交于 2019-12-08 12:38:47
问题 Only recently started using SignalR and I had this working a few days ago and now cannot workout what has gone wrong. I have my hub: [HubName("roleManagementHub")] public class RoleManagementHub : GenericHub<RoleManagementRole> { public RoleManagementHub(ICurrentlyViewingUserService service) : base(service) { } } Which extends a generic hub I have created: public class GenericHub<TEntity> : Hub where TEntity : class, IBusinessObject<TEntity> { private readonly ICurrentlyViewingUserService

App crashes when trying to connect to SignalR server after disconnecting it

こ雲淡風輕ζ 提交于 2019-12-08 11:26:10
问题 I'm building a Xamarin Android app that uses SignalR for the purpose of real time chat. The app crashes when I try to connect to the server again after I disconnect it and when the app relaunches, it connects fine. I have a singleton class that used for the same reference across my solution. The singleton class has the following method to connect to the server: public async Task<string> StartConnection() { hubConnection.Headers.Add("User-Agent", "mobile"); hubConnection.Headers.Add("username"

Using SignalR to notify current caller

独自空忆成欢 提交于 2019-12-08 10:26:24
问题 The short version In my POST action routine, how can I send a notification to some JavaScript running in the client? It seems that SignalR should be an easy solution, but I don't know how to do a callback to the SignalR client that lives in JavaScript in the POST action's client page. Specifically, it seems that I need a "connection ID" in order to ask SignalR to talk to a specific client, but I don't know how to get one of those either in my POST action or in the client JavaScript. The whole

SignalR connection wouldn't start inside a singleton class

百般思念 提交于 2019-12-08 10:07:08
问题 I have setup my signalR connection inside a singleton class so I can use the same connection throughout my entire project. The problem is that the connection never starts and the code never executes beyond the line await hubConnection.Start() however when I do this outside the single class, then the connection is initiated in an instant. I wonder what I'm doing wrong. Here's my definition of the singleton class: public sealed class ProxySubscriber { private static volatile ProxySubscriber