Quick look into SignalR

Abdullah Asım KILIÇ
2 min readOct 12, 2021

We can say that it is a library that simplifies the process of providing real-time web functionality to your applications. So what is real-time web functionality? Contrary to the classical Request-Response type of communication between the Client-Server, it is a simultaneous communication method. The server notifies the clients immediately if there is a manipulation of the data, without waiting for the clients to request new data.

Although projects made with SignalR are generally based on chat applications examples, it is used in many more projects. If users feel the need to refresh the page to check for any changes in their data, the solution to this problem is the SignalR library. Page refresh or link refresh methods to check data up-to-date are very costly in terms of both time and performance.

SignalR takes the connection management from us and performs the tracking itself, which gives us a great advantage. Thus, we can send data to all clients connected to the server or to the desired client at the same time. The connection between the client and the server is permanently established instead of being re-established with each communication as in the HTTP connection.

If we evaluate today’s possibilities, it is realized that the classical communication approach is not enough, the need for different libraries and even protocols as a solution is inevitable. It is obvious that there is a need for a technology that will provide real-time service in projects that will work with instant data, and that WebSocket infrastructure systems that adopt the TCP protocol, unlike HTTP, should be used.

TCP has a bidirectional structure. It allows both parties to send data to each other simultaneously. In the HTTP protocol, the client can trigger the server, but the server cannot trigger the client. The underlying technology of SignalR is WebSocket and in essence it adopts RPC (Remote Procedure Call) mechanism. With RPC, the server can trigger any method in the client to the extent allowed. Thus, applications ensure data transfer without page refresh. We mentioned that it uses WebSocket transport in SignalR. If desired, applications can be written directly using WebSocket, but SignalR carries out the necessary procedures for us in the background on our behalf.

REFERENCES

--

--