SignalR.Code, nottoothpaste               MaartenRealtime client/server   Balliauw                         Technical Consu...
R
Who am I?MaartenBalliauw@maartenballiauw
Why real-time & how?Meet SignalRConnections and HubsClientsQ&A
Why real-time & how?
Twitter – live searches/updatesStock streamersAuctionsLive scoresReal-time notificationsInteractive gamesCollaborative app...
Never designed for real-time communications HTML5 WebSockets to the rescue, right?
Extension to HTTPProvide raw sockets over HTTPFull-duplexTraverses proxiesIt’s still a draft…Not every proxy server suppor...
HTTP/1.1 200 OKContent-Type: text/plainTransfer-Encoding: chunked<script>eval("... ")</script>0<script>eval("... ")</scrip...
Fiddler                   hootsuite.comPolling interval
Fiddlerfacebook.com
Options!Forever FramePeriodic pollingLong pollingHTML5 WebSockets(Server-Sent events)
ARRR!Meet SignalR
Three-in-one!
http://github.com/signalr/signalr
where else!http://amzn.to/xrzS6j
Hello, SignalR
BONUS DEMO!
Connections and Hubs
PersistentConnection HubsCan communicate with 1..N clients   Can communicate with 1..N clientsIs an IHttpHandler          ...
Hello, SignalRhubs
http://jabbr.net
Clients
On the server sideOn the client sideBut there’s more…
On the server side        https://github.com/SignalR/SignalR/tree/master/SignalR.SelfHostOn the client side        Is this...
DeckCast
SignalR is three-in-one!Connections & HubsConnect various clients
Make the web realtime!Install-Package SignalR
http://aka.ms/mbl-techhttp://aka.ms/mbl-tech/devprevhttp://aka.ms/mbl-tech/html5
Maarten      Balliauw      @maartenballiauwQ&A
http://blog.maartenballiauw.behttp://github.com/signalr/signalrhttp://www.nuget.org/packages?q=signalrhttp://github.com/si...
SignalR. Code, not toothpaste
SignalR. Code, not toothpaste
Upcoming SlideShare
Loading in …5
×

SignalR. Code, not toothpaste

11,435 views

Published on

Almost all HTML5 and web applications today make use of AJAX to communicate between client and server. AJAX is great with asynchronous operations, but what about real-time communication? How would you push a message from server to client? HTML5 WebSockets offer a solution to all of these questions but are not supported in every browser and every network environment. SignalR is the new cool kid on the block: it leverages WebSockets when supported and falls back to different mechanisms when they aren’t. In this session, I’ll show you where and how to use SignalR to create rich real-time applications in the browser. No toothpaste. Just code.

Published in: Technology
  • Be the first to comment

SignalR. Code, not toothpaste

  1. 1. SignalR.Code, nottoothpaste MaartenRealtime client/server Balliauw Technical Consultantcommunication RealDolmen @maartenballiauw
  2. 2. R
  3. 3. Who am I?MaartenBalliauw@maartenballiauw
  4. 4. Why real-time & how?Meet SignalRConnections and HubsClientsQ&A
  5. 5. Why real-time & how?
  6. 6. Twitter – live searches/updatesStock streamersAuctionsLive scoresReal-time notificationsInteractive gamesCollaborative apps 6Live user analytics…
  7. 7. Never designed for real-time communications HTML5 WebSockets to the rescue, right?
  8. 8. Extension to HTTPProvide raw sockets over HTTPFull-duplexTraverses proxiesIt’s still a draft…Not every proxy server supports itNot every webserver supports itNot every browser supports itThey are raw sockets!
  9. 9. HTTP/1.1 200 OKContent-Type: text/plainTransfer-Encoding: chunked<script>eval("... ")</script>0<script>eval("... ")</script>0
  10. 10. Fiddler hootsuite.comPolling interval
  11. 11. Fiddlerfacebook.com
  12. 12. Options!Forever FramePeriodic pollingLong pollingHTML5 WebSockets(Server-Sent events)
  13. 13. ARRR!Meet SignalR
  14. 14. Three-in-one!
  15. 15. http://github.com/signalr/signalr
  16. 16. where else!http://amzn.to/xrzS6j
  17. 17. Hello, SignalR
  18. 18. BONUS DEMO!
  19. 19. Connections and Hubs
  20. 20. PersistentConnection HubsCan communicate with 1..N clients Can communicate with 1..N clientsIs an IHttpHandler Abstraction over PersistentConnectionRequires a route to be defined Route automatically mapped (/signalr/hubs)Limited to sending messages Can send messages and call methodsYou define the “protocol” SignalR defines the protocol
  21. 21. Hello, SignalRhubs
  22. 22. http://jabbr.net
  23. 23. Clients
  24. 24. On the server sideOn the client sideBut there’s more…
  25. 25. On the server side https://github.com/SignalR/SignalR/tree/master/SignalR.SelfHostOn the client side Is this a replacement for WCF?
  26. 26. DeckCast
  27. 27. SignalR is three-in-one!Connections & HubsConnect various clients
  28. 28. Make the web realtime!Install-Package SignalR
  29. 29. http://aka.ms/mbl-techhttp://aka.ms/mbl-tech/devprevhttp://aka.ms/mbl-tech/html5
  30. 30. Maarten Balliauw @maartenballiauwQ&A
  31. 31. http://blog.maartenballiauw.behttp://github.com/signalr/signalrhttp://www.nuget.org/packages?q=signalrhttp://github.com/signalr/signalr.websocketshttp://vasters.com/clemensv/2012/02/13/SignalR+Powered+By+Service+Bus.aspxhttps://github.com/DyKnow/SignalR-ObjChttps://github.com/SignalR/SignalR/pull/127

×