SlideShare a Scribd company logo
«Real Time» Web Applications
   with SignalR in ASP.NET
    (using and abusing SignalR)




                                  PrimordialCode
Thanks to the sponsors




                     PrimordialCode
Who am I ?
Alessandro Giorgetti
Co-founder/Owner of         www.grupposid.com

Co-founder of


Email: alessandro.giorgetti@live.com
www: http://www.primordialcode.com
Twitter: @A_Giorgetti


                                       PrimordialCode
Real Time Applications : the
         «customer» viewpoint
• You (the «customer») want data!
• You need them NOW!
• Real Time!
It’s a ‘today’ reality:
• Twitter / Facebook / many more…
• Notifications.
• Auctions / Stock trading / Banking.
• Collaborative apps.

                                        PrimordialCode
What do we «devs» mean with ‘Real
           Time’ applications ?
•   Persistent Connections between endpoints.
•   Two way communication (full-duplex).
•   Low Latency ( :D ).
•   Low overhead.
•   Over the «wire» (intranet/internet/generic
    communication medium).



                                        PrimordialCode
Real Time Web Apps
Our worst enemy:
HTTP

• Stateless
• Request – Response communication pattern.
• Defo: not for real time.



                                    PrimordialCode
WebSockets a «god sent» HTTP
               extension
«the goods»

•   Two way Full Duplex communication.
•   Traverse proxies (ports: 80/443).
•   Low overhead (2 bytes or so).
•   Low latency (~50 ms).
•   W3C standard.
•   It’s a raw socket (flexibility).

                                         PrimordialCode
WebSockets - interface
[Constructor(in DOMString url, optional in DOMString protocol)]
interface WebSocket {
readonly attribute DOMString URL;
// ready state
const unsigned short CONNECTING = 0;
const unsigned short OPEN = 1;
const unsigned short CLOSED = 2;
readonly attribute unsigned short readyState;
readonly attribute unsigned long bufferedAmount;
// networking
attribute Function onopen;
attribute Function onmessage;
attribute Function onclose;
boolean send(in DOMString data);
void close();
};
WebSocket implements EventTarget;
                                                  PrimordialCode
Using WebSockets
var myWebSocket = new WebSocket
      ("ws://www.websockets.org");

myWebSocket.onopen = function(evt) { alert("Connection
open ..."); };
myWebSocket.onmessage = function(evt) { alert(
"Received Message: " + evt.data); };
myWebSocket.onclose = function(evt) { alert("Connection
closed."); };

myWebSocket.send("Hello WebSockets!");
myWebSocket.close();




                                             PrimordialCode
WebSockets: it’s not always gold all
              that shines!
«the badz»

•   It’s a «raw» socket.
•   Not all browsers support it.
•   Not all servers support it.
•   Not all proxies support it.
•   Is it a standard then?


                                   PrimordialCode
How to write RT apps then?
Techniques to simulate Real Time
communications:

•   Polling.
•   Long Polling.
•   Forever Frame.
•   Server Sent Events.


                                   PrimordialCode
Polling: the stubborn approach

                                            Server
          Response
Request




                            delay           Client



                     Time: requests event ‘n’ seconds (fixed time)


                                                                     PrimordialCode
Polling
• High overhead on requests: headers and
  such…
• High overhead on response: same as before…
• High latency.
• Waste of bandwith.
• Waste of resources.



                                    PrimordialCode
Long Polling: the kind gentleman
                      approach
                                          Server
                Response
Request




                           Variable delay Client



               Time: requests event ‘n’ seconds (variable)


                                                             PrimordialCode
Long Polling
• High overhead on requests: headers and
  such…
• High overhead on response: same as before…
• Medium latency.
• Waste less of bandwith.
• Waste of resources.

• Better than the previous one: less requests.

                                        PrimordialCode
Forever Frame: the IE way
IFRAME ("Forever frame"): Loading a page in an IFRAME that incrementally
receives commands wrapped in <script> tags, which the browser evaluates as
they are received.

• Data is sent out in chunks.
• Add an IFrame to the page (its content length is declared to be indefinitely
  long).
• Load in the IFrame a page with a script in it (execute it to get your chunk
  of data).
• The next chunk of data arrives in the form of another script that is
  executed again.
• The cycle goes on and on and on...

• It causes pollution in the long run…all those script tags stays there even if
  you don’t need them anymore.



                                                                 PrimordialCode
Server Sent Events: the others way
From Wikipedia (handle with care):

Server-Sent Events (SSE) are a standard describing how
servers can initiate data transmission towards clients
once an initial client connection has been established.
They are commonly used to send message updates or
continuous data streams to a browser client and designed
to enhance native, cross-browser streaming through a
JavaScript API called EventSource, through which a client
requests a particular URL in order to receive an event
stream.

                                              PrimordialCode
SSE - EventSource
Javascript API: subscribe to a stream and await for messages

if (!!window.EventSource)
{
 var source = new EventSource('stream.php');
}
else
{
 // Result to xhr polling :(
}

source.addEventListener('message',
        function(e) { console.log(e.data); }, false);
source.addEventListener('open',
        function(e) { // Connection was opened. }, false);
source.addEventListener('error',
        function(e) { if (e.readyState == EventSource.CLOSED),
false);



                                                         PrimordialCode
SSE – the stream format
EVENT STREAM FORMAT
Sending an event stream from the source is a matter of
constructing a plaintext response, served with a text/event-
stream Content-Type, that follows the SSE format. In its basic
form, the response should contain a "data:" line, followed by
your message, followed by two "n" characters to end the
stream:

data: My messagenn

There are many more options, for a quick reference:
http://www.html5rocks.com/en/tutorials/eventsource/basics/


                                                   PrimordialCode
So many options and a big
      Headache !
      How to survive ?




                         PrimordialCode
Introducing: SignalR

• Persistent Connection Abstraction communication library.
• Abstracts protocol and transfer (choses the best one).
• A single programming model (a unified development
  experience).
• Extremely simple to use.
• Server-side it can be hosted in different «environments»
  (ASP.NET, console apps, windows services, etc…).
• Client-side there’s support for: Javascript clients, .NET
  clients, WP; provide by the community: iOS, Android.




                                                 PrimordialCode
SignalR: setup demo

Demo: how to setup SignalR,
     GitHub or NuGet,
 see websockets in action.


                              PrimordialCode
SignalR in action




                    PrimordialCode
SignalR: debugging websockets




                        PrimordialCode
SignalR
«Low level» API
• Persistent Connections

manages the connection and the «raw» stream of data.

«High level» API
• Hubs

provide advanced support for internal routing (calling
functions on server & clients), connection and
disconnection tracking, grouping etc…


                                               PrimordialCode
SignalR: PersistentConnection

   Demo: steps needed to use the
      PersistentConnection



                               PrimordialCode
SignalR: Hub

Demo: how to setup and interact
         with Hubs



                             PrimordialCode
SignalR: Hub advanced

 Demo: connection tracking,
        grouping…



                              PrimordialCode
SignalR: Scaling Out
Every instance lives on its own, to make them
communicate and share data we need a …

Backplane:
• Redis.
• Azure Queues.
• Sql Server (soon to be ?).
• Build your own!

                                       PrimordialCode
SignalR: backplane

Demo: use an in-memory database
 to setup a message bus between
     SignalR running instances


                             PrimordialCode
Time for some Q&A ?




                      PrimordialCode
Thanks All for attending!




                       PrimordialCode
Please rate this session
   Scan the code, go online, rate this session




                                                 PrimordialCode

More Related Content

PDF
SignalR
Troy Miles
 
PPTX
Signal R 2015
Mihai Coscodan
 
PPT
SignalR
William Austin
 
PPSX
SignalR With ASP.Net part1
Esraa Ammar
 
PPTX
SignalR for ASP.NET Developers
Shivanand Arur
 
PPTX
SignalR with ASP.NET MVC 6
Tung Nguyen Thanh
 
PPSX
Signalr with ASP.Net part2
Esraa Ammar
 
PPTX
signalr
Owen Chen
 
SignalR
Troy Miles
 
Signal R 2015
Mihai Coscodan
 
SignalR With ASP.Net part1
Esraa Ammar
 
SignalR for ASP.NET Developers
Shivanand Arur
 
SignalR with ASP.NET MVC 6
Tung Nguyen Thanh
 
Signalr with ASP.Net part2
Esraa Ammar
 
signalr
Owen Chen
 

What's hot (20)

PPTX
Building Realtime Web Applications With ASP.NET SignalR
Shravan Kumar Kasagoni
 
PPTX
Real-time ASP.NET with SignalR
Alexander Konduforov
 
PPTX
Introduction to SignalR
Adam Mokan
 
PPTX
Real time Communication with Signalr (Android Client)
Deepak Gupta
 
PDF
Introduction to SignalR
University of Hawai‘i at Mānoa
 
PPTX
Real time web with SignalR
Alessandro Melchiori
 
PPTX
SignalR with asp.net
Martin Bodocky
 
PPT
Intro to signalR
Mindfire Solutions
 
PPTX
SignalR
Eyal Vardi
 
PPTX
SignalR Overview
Michael Sukachev
 
PPTX
Building Real Time Web Applications with SignalR (NoVA Code Camp 2015)
Kevin Griffin
 
PPTX
Real-time Communications with SignalR
Shravan Kumar Kasagoni
 
PPTX
Scale your signalR realtime web application
Ran Wahle
 
PPTX
Web Real-time Communications
Alexei Skachykhin
 
PPTX
Real time web applications with SignalR (BNE .NET UG)
brendankowitz
 
PPTX
SignalR. Code, not toothpaste - TechDays Belgium 2012
Maarten Balliauw
 
PPTX
Microsoft signal r
rustd
 
PPTX
IoT with SignalR & .NET Gadgeteer - NetMF@Work
Mirco Vanini
 
PPTX
Building a Web Frontend with Microservices and NGINX Plus
NGINX, Inc.
 
PPTX
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Binary Studio
 
Building Realtime Web Applications With ASP.NET SignalR
Shravan Kumar Kasagoni
 
Real-time ASP.NET with SignalR
Alexander Konduforov
 
Introduction to SignalR
Adam Mokan
 
Real time Communication with Signalr (Android Client)
Deepak Gupta
 
Introduction to SignalR
University of Hawai‘i at Mānoa
 
Real time web with SignalR
Alessandro Melchiori
 
SignalR with asp.net
Martin Bodocky
 
Intro to signalR
Mindfire Solutions
 
SignalR
Eyal Vardi
 
SignalR Overview
Michael Sukachev
 
Building Real Time Web Applications with SignalR (NoVA Code Camp 2015)
Kevin Griffin
 
Real-time Communications with SignalR
Shravan Kumar Kasagoni
 
Scale your signalR realtime web application
Ran Wahle
 
Web Real-time Communications
Alexei Skachykhin
 
Real time web applications with SignalR (BNE .NET UG)
brendankowitz
 
SignalR. Code, not toothpaste - TechDays Belgium 2012
Maarten Balliauw
 
Microsoft signal r
rustd
 
IoT with SignalR & .NET Gadgeteer - NetMF@Work
Mirco Vanini
 
Building a Web Frontend with Microservices and NGINX Plus
NGINX, Inc.
 
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
Binary Studio
 
Ad

Similar to «Real Time» Web Applications with SignalR in ASP.NET (20)

PPTX
Realtime web experience with signalR
Ran Wahle
 
PDF
SignalR 101
John Patrick Oliveros
 
PPTX
Real time websites and mobile apps with SignalR
Roy Cornelissen
 
PPTX
Real Time Web with SignalR
Bilal Amjad
 
PDF
Real-Time with Flowdock
Flowdock
 
PPTX
Brushing skills on SignalR for ASP.NET developers
ONE BCG
 
PDF
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
PDF
Building real time applications with Symfony2
Antonio Peric-Mazar
 
PDF
What is a WebSocket? Real-Time Communication in Applications
Inexture Solutions
 
PPTX
SignalR powered real-time x-plat mobile apps!
Sam Basu
 
PDF
Real time web apps
Sepehr Rasouli
 
PPTX
Real-time web applications using SharePoint, SignalR and Azure Service Bus
Dinusha Kumarasiri
 
PDF
SignalR: Add real-time to your applications
Eugene Zharkov
 
PDF
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
Swanand Pagnis
 
PPTX
Connected Web Systems
Damir Dobric
 
PDF
Server-Sent Events (real-time HTTP push for HTML5 browsers)
yay w00t
 
PPTX
video conference (peer to peer)
mohamed amr
 
PDF
Introduction to WebSockets
Gunnar Hillert
 
PPTX
SignalR Powered X-Platform Real-Time Apps!
Sam Basu
 
PPTX
ASP.NET MVC 5 and SignalR 2
Jaliya Udagedara
 
Realtime web experience with signalR
Ran Wahle
 
Real time websites and mobile apps with SignalR
Roy Cornelissen
 
Real Time Web with SignalR
Bilal Amjad
 
Real-Time with Flowdock
Flowdock
 
Brushing skills on SignalR for ASP.NET developers
ONE BCG
 
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Viktor Gamov
 
Building real time applications with Symfony2
Antonio Peric-Mazar
 
What is a WebSocket? Real-Time Communication in Applications
Inexture Solutions
 
SignalR powered real-time x-plat mobile apps!
Sam Basu
 
Real time web apps
Sepehr Rasouli
 
Real-time web applications using SharePoint, SignalR and Azure Service Bus
Dinusha Kumarasiri
 
SignalR: Add real-time to your applications
Eugene Zharkov
 
Let's Get Real (time): Server-Sent Events, WebSockets and WebRTC for the soul
Swanand Pagnis
 
Connected Web Systems
Damir Dobric
 
Server-Sent Events (real-time HTTP push for HTML5 browsers)
yay w00t
 
video conference (peer to peer)
mohamed amr
 
Introduction to WebSockets
Gunnar Hillert
 
SignalR Powered X-Platform Real-Time Apps!
Sam Basu
 
ASP.NET MVC 5 and SignalR 2
Jaliya Udagedara
 
Ad

More from Alessandro Giorgetti (9)

PPTX
Microservices Architecture
Alessandro Giorgetti
 
PPTX
Let's talk about... Microservices
Alessandro Giorgetti
 
PPTX
The Big Picture - Integrating Buzzwords
Alessandro Giorgetti
 
PPTX
Angular Unit Testing
Alessandro Giorgetti
 
PPTX
AngularConf2016 - A leap of faith !?
Alessandro Giorgetti
 
PPTX
AngularConf2015
Alessandro Giorgetti
 
PPTX
TypeScript . the JavaScript developer best friend!
Alessandro Giorgetti
 
PPTX
DNM19 Sessione1 Orchard Primo Impatto (ita)
Alessandro Giorgetti
 
PPTX
DNM19 Sessione2 Orchard Temi e Layout (Ita)
Alessandro Giorgetti
 
Microservices Architecture
Alessandro Giorgetti
 
Let's talk about... Microservices
Alessandro Giorgetti
 
The Big Picture - Integrating Buzzwords
Alessandro Giorgetti
 
Angular Unit Testing
Alessandro Giorgetti
 
AngularConf2016 - A leap of faith !?
Alessandro Giorgetti
 
AngularConf2015
Alessandro Giorgetti
 
TypeScript . the JavaScript developer best friend!
Alessandro Giorgetti
 
DNM19 Sessione1 Orchard Primo Impatto (ita)
Alessandro Giorgetti
 
DNM19 Sessione2 Orchard Temi e Layout (Ita)
Alessandro Giorgetti
 

Recently uploaded (20)

PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PDF
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
CDH. pptx
AneetaSharma15
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
20250924 Navigating the Future: How to tell the difference between an emergen...
McGuinness Institute
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 

«Real Time» Web Applications with SignalR in ASP.NET

  • 1. «Real Time» Web Applications with SignalR in ASP.NET (using and abusing SignalR) PrimordialCode
  • 2. Thanks to the sponsors PrimordialCode
  • 3. Who am I ? Alessandro Giorgetti Co-founder/Owner of www.grupposid.com Co-founder of Email: [email protected] www: http://www.primordialcode.com Twitter: @A_Giorgetti PrimordialCode
  • 4. Real Time Applications : the «customer» viewpoint • You (the «customer») want data! • You need them NOW! • Real Time! It’s a ‘today’ reality: • Twitter / Facebook / many more… • Notifications. • Auctions / Stock trading / Banking. • Collaborative apps. PrimordialCode
  • 5. What do we «devs» mean with ‘Real Time’ applications ? • Persistent Connections between endpoints. • Two way communication (full-duplex). • Low Latency ( :D ). • Low overhead. • Over the «wire» (intranet/internet/generic communication medium). PrimordialCode
  • 6. Real Time Web Apps Our worst enemy: HTTP • Stateless • Request – Response communication pattern. • Defo: not for real time. PrimordialCode
  • 7. WebSockets a «god sent» HTTP extension «the goods» • Two way Full Duplex communication. • Traverse proxies (ports: 80/443). • Low overhead (2 bytes or so). • Low latency (~50 ms). • W3C standard. • It’s a raw socket (flexibility). PrimordialCode
  • 8. WebSockets - interface [Constructor(in DOMString url, optional in DOMString protocol)] interface WebSocket { readonly attribute DOMString URL; // ready state const unsigned short CONNECTING = 0; const unsigned short OPEN = 1; const unsigned short CLOSED = 2; readonly attribute unsigned short readyState; readonly attribute unsigned long bufferedAmount; // networking attribute Function onopen; attribute Function onmessage; attribute Function onclose; boolean send(in DOMString data); void close(); }; WebSocket implements EventTarget; PrimordialCode
  • 9. Using WebSockets var myWebSocket = new WebSocket ("ws://www.websockets.org"); myWebSocket.onopen = function(evt) { alert("Connection open ..."); }; myWebSocket.onmessage = function(evt) { alert( "Received Message: " + evt.data); }; myWebSocket.onclose = function(evt) { alert("Connection closed."); }; myWebSocket.send("Hello WebSockets!"); myWebSocket.close(); PrimordialCode
  • 10. WebSockets: it’s not always gold all that shines! «the badz» • It’s a «raw» socket. • Not all browsers support it. • Not all servers support it. • Not all proxies support it. • Is it a standard then? PrimordialCode
  • 11. How to write RT apps then? Techniques to simulate Real Time communications: • Polling. • Long Polling. • Forever Frame. • Server Sent Events. PrimordialCode
  • 12. Polling: the stubborn approach Server Response Request delay Client Time: requests event ‘n’ seconds (fixed time) PrimordialCode
  • 13. Polling • High overhead on requests: headers and such… • High overhead on response: same as before… • High latency. • Waste of bandwith. • Waste of resources. PrimordialCode
  • 14. Long Polling: the kind gentleman approach Server Response Request Variable delay Client Time: requests event ‘n’ seconds (variable) PrimordialCode
  • 15. Long Polling • High overhead on requests: headers and such… • High overhead on response: same as before… • Medium latency. • Waste less of bandwith. • Waste of resources. • Better than the previous one: less requests. PrimordialCode
  • 16. Forever Frame: the IE way IFRAME ("Forever frame"): Loading a page in an IFRAME that incrementally receives commands wrapped in <script> tags, which the browser evaluates as they are received. • Data is sent out in chunks. • Add an IFrame to the page (its content length is declared to be indefinitely long). • Load in the IFrame a page with a script in it (execute it to get your chunk of data). • The next chunk of data arrives in the form of another script that is executed again. • The cycle goes on and on and on... • It causes pollution in the long run…all those script tags stays there even if you don’t need them anymore. PrimordialCode
  • 17. Server Sent Events: the others way From Wikipedia (handle with care): Server-Sent Events (SSE) are a standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. They are commonly used to send message updates or continuous data streams to a browser client and designed to enhance native, cross-browser streaming through a JavaScript API called EventSource, through which a client requests a particular URL in order to receive an event stream. PrimordialCode
  • 18. SSE - EventSource Javascript API: subscribe to a stream and await for messages if (!!window.EventSource) { var source = new EventSource('stream.php'); } else { // Result to xhr polling :( } source.addEventListener('message', function(e) { console.log(e.data); }, false); source.addEventListener('open', function(e) { // Connection was opened. }, false); source.addEventListener('error', function(e) { if (e.readyState == EventSource.CLOSED), false); PrimordialCode
  • 19. SSE – the stream format EVENT STREAM FORMAT Sending an event stream from the source is a matter of constructing a plaintext response, served with a text/event- stream Content-Type, that follows the SSE format. In its basic form, the response should contain a "data:" line, followed by your message, followed by two "n" characters to end the stream: data: My messagenn There are many more options, for a quick reference: http://www.html5rocks.com/en/tutorials/eventsource/basics/ PrimordialCode
  • 20. So many options and a big Headache ! How to survive ? PrimordialCode
  • 21. Introducing: SignalR • Persistent Connection Abstraction communication library. • Abstracts protocol and transfer (choses the best one). • A single programming model (a unified development experience). • Extremely simple to use. • Server-side it can be hosted in different «environments» (ASP.NET, console apps, windows services, etc…). • Client-side there’s support for: Javascript clients, .NET clients, WP; provide by the community: iOS, Android. PrimordialCode
  • 22. SignalR: setup demo Demo: how to setup SignalR, GitHub or NuGet, see websockets in action. PrimordialCode
  • 23. SignalR in action PrimordialCode
  • 25. SignalR «Low level» API • Persistent Connections manages the connection and the «raw» stream of data. «High level» API • Hubs provide advanced support for internal routing (calling functions on server & clients), connection and disconnection tracking, grouping etc… PrimordialCode
  • 26. SignalR: PersistentConnection Demo: steps needed to use the PersistentConnection PrimordialCode
  • 27. SignalR: Hub Demo: how to setup and interact with Hubs PrimordialCode
  • 28. SignalR: Hub advanced Demo: connection tracking, grouping… PrimordialCode
  • 29. SignalR: Scaling Out Every instance lives on its own, to make them communicate and share data we need a … Backplane: • Redis. • Azure Queues. • Sql Server (soon to be ?). • Build your own! PrimordialCode
  • 30. SignalR: backplane Demo: use an in-memory database to setup a message bus between SignalR running instances PrimordialCode
  • 31. Time for some Q&A ? PrimordialCode
  • 32. Thanks All for attending! PrimordialCode
  • 33. Please rate this session Scan the code, go online, rate this session PrimordialCode