I will try to make a short short story:
I want to call a method on a hub in a web application from the main assembly in my application. The reason is because I have several applications that end up triggering kernel and trigger events (think about mobile websites, admin sites, api, etc.). I want to notify users of the location of events on the desktop, as they are, using SignalR.
To reveal this, I created a 4-design solution. The main project with a proxy server. Web application with a hub. Another web application without a hub. And finally, a console application.
If I call the kernel from a console application and try to send a message to a hub client using a proxy server, everything will be fine. However, if I try to call the kernel and use a proxy server from one of the web applications, execution freezes when connection.Start () is called:
var connection = new HubConnection("..."); var hub = connection.CreateProxy("Spike.Hub"); connection.Start().Wait();
Is SignalR.Client material not intended to be used from the application domain of a web application? Why does this work in a console application, but not from a web application?
Update: I connected my burst to the SignalR signal source and when I start from one of the web applications, execution freezes at line 130 of SignalR.Client.Connection. _syncContext for such a connection is an instance of AspNetSynchronizationContext, and when the Post () method is called, everything stops.
spot
source share