What is SIGNALR?
ASP.net signalr is a class library that is provided to simplify development developers ' adding live Web content to application procedures. The real-time web function is to allow server code to actively push content to the client at any time, rather than having the server wait for the client's request (to return content).
All "live" kinds of web features can be added to your asp.net application using SIGNALR. The most common examples are chat rooms, but we can do much more than that. Consider the following scenarios: Users need to constantly refresh the page to see the latest data, or to retrieve new data (and display) by implementing long polling on the page, then you can consider using SIGNALR to implement it. Examples include dashboard and monitoring applications, collaborative applications such as multiple people editing documents at the same time, job progress updates, and real-time rendering of forms.
SIGNALR is also suitable for new types of Web applications that require high frequency updates from the server, such as real-time gaming. Here's a good example: Shoorr.
SIGNALR provides a simple API user to create a remote procedure call (RPC) from the server to the client, which makes it easy to invoke the JS functions in the client browser and other client platforms from the server-side. NET code. SIGNALR also includes the management of connections (for example, connection and disconnect events) and grouping of connections.
SIGNALR can be managed automatically on a connection. And let you send broadcast messages to all connected clients, just like a chat room. Of course, in addition to mass, you can also send messages to a specific client. The client-server connection is persistent, unlike the traditional HTTP protocol that requires a connection to be reconnected for every communication.
SIGNALR supports the server push feature, where server code can invoke client code in the browser by using remote procedure call (RPC) instead of the current request-processing model that is commonly used on the web.
SIGNALR applications can be extended to thousands of clients using a service bus, SQL Server, or Redis.
SIGNALR is open source and you can access it through GitHub.
SIGNALR and WebSocket
SIGNALR uses WebSocket transmission mode-where possible. and will automatically switch to the old transmission mode (such as the HTTP long connection). You can of course use WebSocket directly to write your application, but using SIGNALR means you will have more extra functionality without reinventing the wheel. Most importantly, you can focus on the business implementation without having to consider creating compatible code for the old client individually. SIGNALR also allows you to not worry about WebSocket updates, as SIGNALR will continue to be updated to support the changing underlying transmission, providing a consistent access interface across different versions of WebSocket.
Of course, you can create a solution that uses only WebSocket transmissions, SIGNALR provides all the functionality you might need to write your own code, such as fallback to other transmissions and modifying your application for an updated WebSocket implementation.