SignalR Console app example

First of all, you should install SignalR.Host.Self on the server application and SignalR.Client on your client application by nuget : PM> Install-Package SignalR.Hosting.Self -Version 0.5.2 PM> Install-Package Microsoft.AspNet.SignalR.Client Then add the following code to your projects 😉 (run the projects as administrator) Server console app: using System; using SignalR.Hubs; namespace SignalR.Hosting.Self.Samples { class Program { … Read more

Using SignalR with Redis messagebus failover using BookSleeve’s ConnectionUtils.Connect()

The SignalR team has now implemented support for a custom connection factory with StackExchange.Redis, the successor to BookSleeve, which supports redundant Redis connections via ConnectionMultiplexer. The initial problem encountered was that in spite of creating my own extension methods in BookSleeve to accept a collection of servers, fail-over was not possible. Now, with the evolution … Read more

SignalR – Sending a message to a specific user using (IUserIdProvider) *NEW 2.0.0*

SignalR provides ConnectionId for each connection. To find which connection belongs to whom (the user), we need to create a mapping between the connection and the user. This depends on how you identify a user in your application. In SignalR 2.0, this is done by using the inbuilt IPrincipal.Identity.Name, which is the logged in user … Read more

Can I incorporate both SignalR and a RESTful API?

Take a look at the video from this blog post. It explains exactly how you can use WebAPI with SignalR. Essentially, Web API + SignalR integration consists in this class: public abstract class ApiControllerWithHub<THub> : ApiController where THub : IHub { Lazy<IHubContext> hub = new Lazy<IHubContext>( () => GlobalHost.ConnectionManager.GetHubContext<THub>() ); protected IHubContext Hub { get … Read more

SignalR: Why choose Hub vs. Persistent Connection?

From what I see in the Connection and Hubs section it seems that Hubs provide a topic system overlaying the lower-level persistent connections. From the highly up-voted comment below: Partially correct. You can get topics or groups in persistent connections as well. The big difference is dispatching different types of messages. For example you have … Read more

How SignalR works internally?

No, SignalR is an abstraction over a connection. It gives you two programming models over that connection (hubs and persistent connections). SignalR has a concept of transports, each transport decides how data is sent/received and how it connects and disconnects. SignalR has a few built in transports: WebSockets Server Sent Events Forever Frame Long polling … Read more

.net localhost website consistently making get arterySignalR/poll?transport=longPolling&connectionToken= calls

This is working as intended. Artery aka BrowserLink is a real-time connection from Visual Studio to all browsers running your code. It essentially allows Visual Studio to interact with every browser. For instance if you have IE, Opera, Chrome and Firefox all running your code and you’re trying to ensure cross browser correctness; instead of … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)