SlideShare a Scribd company logo
Real-Time Web
Lesson 1
Client-Server Communication in ASP.NET MVC
#SignalR
By Muhammad Bilal Amjad
Afterthissessionyouwill becapableofusing:
Real Time Functionalities
Client-Server Communication
SignalR
Various Use Cases
How does SignalR Works
Session being delivered by: Muhammad Bilal Amjad
www.bilalamjad.net | bilalamjad@azurewebsites.net
What is SignalR
Adding real-tine web functionality to applications.
Handles connection management automatically and lets you broadcast messages to
all connected clients simultaneously, like a chat room.
You can also send messages to specific clients.
Create persistent connection between server and client(s) in ASP.NET allowing you to
push data from server to client unlike a classic HTTP connection whish is re-
established for each communication.
Available at Nuget Packages, use “install-package signalr” command to add it into
your project.
Examples and Use-cases
Chat
Real-time impact analysis on current users.
Implementing Push notifications and pub-sub mechanisms.
Real-time charting without repeat client-side ajax polling
Collaborative applications allowing multiple users to interact with the same screen.
Real-time analytics dashboard showing client details (Geo-location based on IP
address browser info, screen resolution, etc)
Transport Mechanisms
SignalR uses one of multiple technologies to set up communications between client
and server. Web Socket, which was introduced with HTML5, provides bidirectional
support but it is not supported by all the browsers and older versions.
As we can’t guarantee what browser will be used by the user, we can’t simply rely on
this, so there must be some way which can implement similar features across
browsers. To do t his, SignalR allows you to use multiple transport technologies and
select one which is most suitable for the scenario.
Web Sockets
Web Socket – This communication technology provides a true two-way
communication over a single TCP connection on web.
In other words, if both the parties (Client and server) supports web socket, then this
creates a persistent connection between them which can be used by either client or
server to send the data anytime. As such, this is most efficient, takes less memory and
shows the lowest latency. This is the most preferred protocol for a SignalR application.
Server Sent Events (Event Source)
Server Sent Events (also known as Event Source) – This is another technique
introduced with HTML5 which allows the server to push the updates to the client
whenever new data is available. This technology is used when Web Socket is not
supported. It is supported by most browsers except IE.
Forever Frame
This is part of the COMET model.
Comet is a web application model in which a long-held HTTPS request allows
a web server to push data to a browser, without the browser explicitly requesting it.
Forever frame uses a hidden iframe on the browser to receive the data in an
incremental manner from the server. The server starts sending the data in a series of
chunks even without even knowing the complete length of the content. It is executed
on the client when the data is received.
Ajax Long Polling
This is the least preferred way in SignalR to set up a communication between Client
and Server. Also, it is the most expensive amongst all, too! It is a part of the COMET
model and as the name suggests, it keeps polling the server to check for updates. The
request that is sent to the server is AJAX based, to minimize the resource usage and
provide a better user experience. But it’s still expensive because it keeps polling the
server whether there are any updates or not.
How SignalR Works
Session being delivered by: Muhammad Bilal Amjad
www.bilalamjad.net | bilalamjad@azurewebsites.net
SignalR Persistent Connection
This is a lower level API which allows us to send raw messages to different clients. We
can also customize this based on the different types of messages and different clients,
and can send these details with the message as well. In simple words, on one hand it
gives us more control over connecting and sending different types of messages, while
on the other hand we need to write more code.
SignalR Hubs
Hubs – These are higher level APIs which are built on top of the Persistent
connections. Hubs hide all the complexities from the developer and provide us a
simple RPC style model with the unique function defined.
Remote Procedure Call (RPC) is a protocol that one program can use to request a
service from a program located in another computer on a network without having to
understand the network's details.
Next Lesson : Configuring SignalR
Thank you for watching
Thank you!
You can follow me
@mbilalamjad/
www.bilalamjad.net
www.facebook.com/bilal.amjad

More Related Content

PPTX
Building Realtime Web Applications With ASP.NET SignalR
PPTX
Web Real-time Communications
PPTX
SignalR Overview
PPT
Intro to signalR
PPTX
Flex Messeging Services
PPTX
Real time web applications with SignalR (BNE .NET UG)
PPTX
Introduction to SignalR
PDF
Introduction to SignalR
Building Realtime Web Applications With ASP.NET SignalR
Web Real-time Communications
SignalR Overview
Intro to signalR
Flex Messeging Services
Real time web applications with SignalR (BNE .NET UG)
Introduction to SignalR
Introduction to SignalR

What's hot (20)

PPTX
SignalR with asp.net
PDF
Adventures in Serverless Backends
PPSX
SignalR With ASP.Net part1
PPTX
Serverless
PPTX
Real time web applications with signal r
PPT
Reverse proxy
PPTX
Mule esb stripe
PPTX
Realtime web experience with signalR
PPTX
SignalR
PDF
Android & Monkey Web Services
PPT
Reverse proxy
PPTX
Realtime web open house
PPSX
Signalr with ASP.Net part2
PPTX
Reverse proxy
PPTX
Mule Microsoft Share Point 2013 Connector
PPTX
Cloud hub scalability and availability
PPTX
Clean up this mess - API Gateway & Service Discovery in .NET
PPTX
Apinizer - Full API Lifecycle and Integration Platform
PPTX
Nginx Conference 2016 - Learnings and State of the Industry
DOCX
Microservices with asp dot net core, a next gen technology
SignalR with asp.net
Adventures in Serverless Backends
SignalR With ASP.Net part1
Serverless
Real time web applications with signal r
Reverse proxy
Mule esb stripe
Realtime web experience with signalR
SignalR
Android & Monkey Web Services
Reverse proxy
Realtime web open house
Signalr with ASP.Net part2
Reverse proxy
Mule Microsoft Share Point 2013 Connector
Cloud hub scalability and availability
Clean up this mess - API Gateway & Service Discovery in .NET
Apinizer - Full API Lifecycle and Integration Platform
Nginx Conference 2016 - Learnings and State of the Industry
Microservices with asp dot net core, a next gen technology
Ad

Similar to Real Time Web with SignalR (20)

PPTX
Real time Communication with Signalr (Android Client)
PDF
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
PDF
Subscription based control system to automate management of events for robots
PPTX
Client server chat application
PPTX
Java Networking
PPTX
REST APIs and MQ
PPTX
SignalR Powered X-Platform Real-Time Apps!
PDF
05 20254 financial stock application
PPTX
SignalR powered real-time x-plat mobile apps!
PPTX
Come ti "pusho" il web con WebSockets: da 0 a SignalR
PPTX
Real-time Communications with SignalR
DOC
WCF tutorial
PDF
What is a WebSocket? Real-Time Communication in Applications
PDF
Building and Scaling a WebSockets Pubsub System
PDF
Realtime mobile&iot solutions using mqtt and message sight
PPTX
Signal R 2015
PPTX
Chat server nitish nagar
PPTX
Web programming
PPTX
Presentation1REVIEW
PPTX
Aplicaciones en tiempo real con SignalR
Real time Communication with Signalr (Android Client)
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
Subscription based control system to automate management of events for robots
Client server chat application
Java Networking
REST APIs and MQ
SignalR Powered X-Platform Real-Time Apps!
05 20254 financial stock application
SignalR powered real-time x-plat mobile apps!
Come ti "pusho" il web con WebSockets: da 0 a SignalR
Real-time Communications with SignalR
WCF tutorial
What is a WebSocket? Real-Time Communication in Applications
Building and Scaling a WebSockets Pubsub System
Realtime mobile&iot solutions using mqtt and message sight
Signal R 2015
Chat server nitish nagar
Web programming
Presentation1REVIEW
Aplicaciones en tiempo real con SignalR
Ad

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
KodekX | Application Modernization Development
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Understanding_Digital_Forensics_Presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
KodekX | Application Modernization Development
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx

Real Time Web with SignalR

  • 1. Real-Time Web Lesson 1 Client-Server Communication in ASP.NET MVC #SignalR By Muhammad Bilal Amjad
  • 2. Afterthissessionyouwill becapableofusing: Real Time Functionalities Client-Server Communication SignalR Various Use Cases How does SignalR Works Session being delivered by: Muhammad Bilal Amjad www.bilalamjad.net | bilalamjad@azurewebsites.net
  • 3. What is SignalR Adding real-tine web functionality to applications. Handles connection management automatically and lets you broadcast messages to all connected clients simultaneously, like a chat room. You can also send messages to specific clients. Create persistent connection between server and client(s) in ASP.NET allowing you to push data from server to client unlike a classic HTTP connection whish is re- established for each communication. Available at Nuget Packages, use “install-package signalr” command to add it into your project.
  • 4. Examples and Use-cases Chat Real-time impact analysis on current users. Implementing Push notifications and pub-sub mechanisms. Real-time charting without repeat client-side ajax polling Collaborative applications allowing multiple users to interact with the same screen. Real-time analytics dashboard showing client details (Geo-location based on IP address browser info, screen resolution, etc)
  • 5. Transport Mechanisms SignalR uses one of multiple technologies to set up communications between client and server. Web Socket, which was introduced with HTML5, provides bidirectional support but it is not supported by all the browsers and older versions. As we can’t guarantee what browser will be used by the user, we can’t simply rely on this, so there must be some way which can implement similar features across browsers. To do t his, SignalR allows you to use multiple transport technologies and select one which is most suitable for the scenario.
  • 6. Web Sockets Web Socket – This communication technology provides a true two-way communication over a single TCP connection on web. In other words, if both the parties (Client and server) supports web socket, then this creates a persistent connection between them which can be used by either client or server to send the data anytime. As such, this is most efficient, takes less memory and shows the lowest latency. This is the most preferred protocol for a SignalR application.
  • 7. Server Sent Events (Event Source) Server Sent Events (also known as Event Source) – This is another technique introduced with HTML5 which allows the server to push the updates to the client whenever new data is available. This technology is used when Web Socket is not supported. It is supported by most browsers except IE.
  • 8. Forever Frame This is part of the COMET model. Comet is a web application model in which a long-held HTTPS request allows a web server to push data to a browser, without the browser explicitly requesting it. Forever frame uses a hidden iframe on the browser to receive the data in an incremental manner from the server. The server starts sending the data in a series of chunks even without even knowing the complete length of the content. It is executed on the client when the data is received.
  • 9. Ajax Long Polling This is the least preferred way in SignalR to set up a communication between Client and Server. Also, it is the most expensive amongst all, too! It is a part of the COMET model and as the name suggests, it keeps polling the server to check for updates. The request that is sent to the server is AJAX based, to minimize the resource usage and provide a better user experience. But it’s still expensive because it keeps polling the server whether there are any updates or not.
  • 10. How SignalR Works Session being delivered by: Muhammad Bilal Amjad www.bilalamjad.net | bilalamjad@azurewebsites.net
  • 11. SignalR Persistent Connection This is a lower level API which allows us to send raw messages to different clients. We can also customize this based on the different types of messages and different clients, and can send these details with the message as well. In simple words, on one hand it gives us more control over connecting and sending different types of messages, while on the other hand we need to write more code.
  • 12. SignalR Hubs Hubs – These are higher level APIs which are built on top of the Persistent connections. Hubs hide all the complexities from the developer and provide us a simple RPC style model with the unique function defined. Remote Procedure Call (RPC) is a protocol that one program can use to request a service from a program located in another computer on a network without having to understand the network's details.
  • 13. Next Lesson : Configuring SignalR Thank you for watching
  • 14. Thank you! You can follow me @mbilalamjad/ www.bilalamjad.net www.facebook.com/bilal.amjad