All Blog Posts

Building Real-Time Web Application with SignalR


What is SignalR?

It is a technology that enables us to create persistent connections between clients and servers. To keep a connection alive between a client and a server SignalR uses WebSocket and HTML5 API. Nowadays you find such types of real-time applications in your mobile app, your email clients, various chat applications, and stock market websites.

"In technical terms, SignalR majorly depends on WebSockets and HTML5 API that enables bidirectional communication between the client and the server."

Now let me explain to you the various important points which I have mentioned in this paragraph.
 

What is a Persistent Connection?

It is a type of connection between the client and the server which remains active or open as long as the user does not refresh the browser, this connection becomes inactive or close when the user navigates to some other page or refreshes the browser. But an application that does not use SignalR can't keep an active connection between the client and the server.

So whenever a client sends an HTTP request to the server a connection is established till the client receives an HTTP response from the server. This connection remains active and open during the request and response process only and becomes inactive or close when the client finishes the process of receiving a response from the server.

What is Websocket?

Websocket is an advanced technology using which we can establish two-way communication between the user's browser and the webserver. Websocket protocol is different from HTTP protocol whereas both technologies create a connection between the client and the server.

I think I must clear one point here, the difference between WebSocket and HTTP protocol. As I have mentioned above Websocket helps in establishes a persistent connection that remains open and active till the user navigates to the other page or refreshes his browser. While HTTP establishes a connection that remains open till the user receives an HTTP response from the server. Also, HTTP is a stateless protocol and starts with HTTP:// or HTTPS:// whereas WebSocket is a stateful protocol and starts with WS:// or WSS://

WebSocket technology can be used in developing a real-time application, game application, or chat application.

What is RPC?

It is an abbreviation for "Remote Procedure Call" and SignalR uses the RPC API when Websocket is not available for any reason.


Post By Wasim Shaikh on Sunday 11 Apr, 2021

Recent Blog Posts

View All
Learn Software Clean Architecture

Professional AutoCAD Designing Training

It is a Mechanical, Civil And Electrical Industrial Designing Software. This software very important role playing in these industries. We are Teaching you 2D Designing in AutoCAD And also we have SOLIDWORKS And CATIA V5 3D Designing Software.

Learn Software Clean Architecture

Addining Blazor WebAssembly To Existing ASP.Net MVC Project in ASP.Net Core 5

In this article, I have explained how we can make an existing ASP.Net MVC Application more powerful by integrating ASP.Net Web Assembly into it, I explained how to configure startup.cs file so we can run Blazor WebAssembly and ASP.Net MVC Together

Learn Software Clean Architecture

Building Real-Time Web Application with SignalR

Building Real-Time web applications in ASP.Net Core 5 is now easy using SignalR, We can now establish bidirectional communication between the client and server using SignalR. It takes advantage of Websocket and HTML5 API for persistent connections.

Learn Software Clean Architecture

An Introduction To ASP.Net Core

It is a web development framework developed by Microsoft, it’s first version ASP.Net 1.0 was released in the year 2002 and last version was ASP.Net 4.7.1 which was released in 2017. It is a robust framework to develop cross platform apps