I'm attempting to build a windows service that's self-hosting SignalR.
I have read through tutorials such as SignalR Self-Host on ASP.Net
I'm noticing that, least it seems, that they're based around broadcasting messages, and can't seem to find anything around listening.
I need to listen to messages from within the service, as well as broadcast.
We already have our backplane setup - it's the same one that the site uses.
In a web site I can join a group, via Javascript. How do I join a group in a self-hosted SignalR service.
In a web site I register a callback on a hub. How do i register the same callback in a self-hosted service?
some example code that I have in place, for registering and starting SignalR is:
GlobalHost.DependencyResolver.UseSqlServer(Settings.Default.ISDBContext);
app.Map("/signalr", map =>
{
map.UseCors(CorsOptions.AllowAll);
HubConfiguration hubConfig = new HubConfiguration()
{
EnableDetailedErrors = true,
EnableJSONP = true,
};
map.RunSignalR(hubConfig);
});
I then start my webApp like this:
SignalR = WebApp.Start<Startup>(options);
options are the url's i'm registering. Startup is the startup class containing the signalR mapping above.
Little lost here as I haven't built a self-hosting service before