Introduction

SignalR is an open-source library that helps to add real-time web functionality to your application. It also enables the server side to push the content to the client instantly rather than the server waiting for the client request from a user for new data.

SignalR can be used for that kind of application where there is a high frequency of updates from the server, such as social networking, etc. Also, it is very helpful when the application requires notifications, such as email, games, etc. It has been used in dashboards and monitoring applications.

SignalR has been rewritten for ASP.NET Core 2.1 which helps with improvements in several areas like.

Some of the popular features of SignalR are,

Signal R is very popular in handling multiple real-time communications, such as Web Sockets, Server-Sent Events, and Long Polling. Also, it automatically selects the best transport method which is suitable for the server and client which is called HUBS.

Hubs

A hub is used to communicate between a server and a client in SignalR. It is basically a high-level pipeline that allows the client and the server to call methods on each other.

It has basically two built-in hub protocols.

In this mechanism, hubs call a client-side method by sending messages that contain the name of the method and its parameter. The method parameters are de-serialized using the configured protocol and if the client matches the name of the method and if it is found, it calls that method and de-serializes the parameter data.