What
is SignalR?
SignalR
is open source .Net library managed by David Fowler and Damien Edwards and well
supported by Microsoft and now it is part of ASP.Net framework as well. You can
see this project on GitHub.
![]() |
Interaction using SignalR |
Key
points about SignalR:
·
SignalR
is invented by David Fowler and Damien Edwards in August 2011.
·
SignalR
is an asynchronous signaling framework to help build real-time, multi-user
interactive web applications.
·
Real
time means connection and conversation happens in real time, for e.g. chat
server.
·
It
is built on top of ASP.NET (server side) and a JavaScript library (on the
client side) that enables clients (browser) and server (ASP.NET based)
components to have a bidirectional conversation.
·
SignalR
will use WebSockets when it's available, and gracefully fallback to other
technologies when it isn't, while your application code remains the same.
·
WebSocket
is a new HTML5 API that enables bi-directional communication between the
browser and server and that is exactly what we want to achieve through SignalR.
·
It
maintains a persistent connection between client and server and lets the client
send multiple messages to the server and the server replies those messages asynchronously.
·
It
uses an existing technique called long polling and keeps the connections open
between a client and web server.
·
It
provides support for connection management, e.g. connect/disconnect events,
grouping connections, authorization etc.
·
It
also provides a very simple and high-level API for calling JQuery/JavaScript
functions in your clients' browsers from server-side ASP.NET code (i.e. server
to client RPC).
·
It
can be considered as a solution dealing with stateless nature of web by making
the web appear to behave in a stateful way.
Why
do we need SignalR?
This
question run in our mind whenever we learn any new technology and SignalR is
not an exception in this case J
·
It
is an open-source .NET library for building web applications that require real-time
data updates or live user interaction.
·
Most
common examples where SignalR can be used are news tickers, sport site, chat
clients, stock or weather updates.
·
Any
web application or web page that implements Ajax long polling to retrieve new
data, is good candidate for using SignalR.
·
SignalR
also enable us to create rich collaborative web applications in ASP.NET, for
e.g. real-time gaming.
Prerequisites
to create SignalR application:
To get
started with SignalR you will need a few things installed:
·
Visual
Studio 2012 Express (or any version of Visual Studio 2012 Professional and up)
or Visual Studio 2010 SP1.
·
2012
Express Development Tool.
·
For
Visual Studio 2010, install ASP.NET MVC 4.
·
If
you don’t have any of required tools then you can check ASP.Net download page and install them.
In next post we’ll use SignalR to create a sample chat application.
Comments
Post a Comment