“Introduction to ASP.NET Core Signal-R”
![ASP.NET Core Signal-R](https://media.ttmind.com/Media/tech/article_33_8-11-20182-39-29PM.jpg)
• Introduction to Signal-R
ASP.NET Core Signal-R is an open source library that helps the adding of real-time web functionality in apps. This function enables the server-side to push contents to clients immediately.
Some of the good candidates for Signal R can be:
• Apps requiring high-frequency updates from the server such as gaming, voting, social networking, maps and GPS apps.
• Whiteboard and Collaborative apps.
• Monitoring and dashboard apps. Company dashboards, instant sales updates app are some of the examples of these type of apps.
• Apps that require frequent notifications such as email, social network.
• History of Signal-R
Signal R was first created in 2011 by Damian Edwards and David Fowler, who now play a key role in the development of ASP.NET. Signal R was finally released as the part of ASP.NET in 2013.
Signal R was first set to solve the problem in real-time messaging for the web, as AJAX polling and long-polling were used by the developers in the past and those were inefficient techniques.
Exploring the working of Signal R, Signal R first arranges the best protocol to be used for a particular connection based on the support of both the client and the server. And then, a consistent API is provided for sending and receiving the messages in real-time.
"When Signal R was first introduced, most of the web applications used JQuery, which made easy for the Signal R Javascript client to depend on JQuery."
"Signal-R focused on managing different protocols to achieve real-time messaging before the web-socket protocol which was adopted by the web browsers."
Now in 2018, as Javascript has been able to achieve various JQuery’s functionality, front-end frameworks like Angular, React etc. have emerged to replace JQuery as the new foundations where SPAs (Single-Page Applications) are built. Other features in Signal R such as turnkey scale-out, automatic reconnection were intended to make it easier to use but they ended up adding more inefficiency and complexity to the framework.
Features of Signal-R for .NET Core:
• Handles automated connection management
• Send messages to all the connected clients concurrently. Example: A chat room.
• Scales to handle increasing traffic.
Transports
Signal-R supports various techniques for handling real-time communications:
• Server-sent Events
• Long Polling
• Web-Sockets
Hubs
Signal-R uses hubs to communicate between client and server. Signal R allows clients to call methods as the server and vice-versa. Strongly typed parameters can be passed to the methods, which enables model binding. Signal-R provides various built-in hub protocols: a text protocol based on JSON and a binary protocol based on Message Pack.
[Note: Message Pack usually creates smaller messages in compared to JSON.]