HTTP Vs Signal R

Smart Saravanan
2 min readFeb 23, 2020

What is Signal R,we can say the abbreviation for signal R as Real time application based on signals.what do i mean by real time application is when some one send message in whats app, other person’s mobile immediately getting notification(if the connection is on since the connection act as tunnel). Similarly when we post something in face book all the others accounts immediately notified ,these all are some examples of real time applications.Signal R helps us to implement these kinds of application.

We can separate every traditional application as two major parts

1)Server

2)Client

Now ,these two separate parts has to communicate with each other to full fill the application.For that we will normally use HTTP protocol.

Now ,what is HTTP?. As many of us know HTTP(Hyper Text Transfer Protocol) is the underlying protocol which is used by world wide web (WWW) to transfer the data in defined format.but the problem with HTTP is Stateless.What do i mean by stateless is when client sends request to server ,then server will process the request and send the response back to the client for the request ,but server will not remember anything about that request once the response is sent.Even if the server gets a new update or new data for the same request server cannot push data to the client since the connection is already closed. next time server will consider the same request as a brand new request for its process.So we need to find out a way to maintain state in server side like session and cookies.

HTTP Communication

Unlike HTTP, Signal R creates a persistent connection between client and server based on any of the following 4 contracts

  1. Long pooling

2.Forever Frame

3.Event source

4.Web socket

Choosing the best contract among the above 4 is based on multiple factors ,and signal R will take care of that as part of negotiation process.we don’t need to explicitly choose the contract.

Signal R communication with persistent connection

So thorough this persistent connection client and server can able to communicate with each other (Bi directional communication) without creating the new connection each time.This persistent connection will get closed when we exit from application or close the browser tab.We can create multiple client connection from the single server and signal R is heavily scalable for even millions of client connection.

We can able to create user group with number of client connection and able to send notification for the respective group alone.All of the Signal R client connections are managed in once place called Hub.

--

--