SignalR/SignalR — Issue #221: Using HubConnection from within ASP.NET app domain.
Author: mccalltd
Created: 2012-03-03 00:19:34+00:00
State: open

Not sure if this is a bug or not, but here goes:

I am trying to use the HubConnection to create a hub proxy to call a method in a hub. I want to call through this proxy from a core project in my application because I have a number of front-end apps that trigger events (I have an api site, an admin site, a mobile site, and a desktop site where the hub is hosted), and I want to notify users of the desktop sites of relevant events. At [line 130 of SingalR.Client.Connection](https://github.com/SignalR/SignalR/blob/master/SignalR.Client/Connection.cs#L130), the _syncContext is an AspNetSynchronizationContext, and the call to Post() never returns. I have a spike project that also has a console app that calls into core and the hub via the proxy, and everything works as expected, since the _syncContext is null and the Post() method is never called, and so never hangs.

I'm not sure whether this is a bug or not, or if the HubConnection is not intended to be used from within an ASP.NET app domain. As the SynchronizationContext object is a new concept for me, I have to do some learning to determine whether this is a bug or not.

If you can give me any guidance about this, it'd be much appreciated. I'll continue looking into it as time permits.

Thanks,

Tim