Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Introduction to SignalR


Published on

A modified version of my Desert Code Camp 2011.2 presentation on SignalR from November 5th, 2011.

It's modified since I'm more of a talker and rarely utilize bullet points and much text in my slides.

Published in: Technology
  • Follow the link, new dating source: ❤❤❤ ❤❤❤
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ❤❤❤ ❤❤❤
    Are you sure you want to  Yes  No
    Your message goes here

Introduction to SignalR

  1. 1. Adam Mokan @adammokanDesert Code Camp Nov 5th, 2011
  2. 2. What is SignalR?• Creates a “persistent connection” between server and client(s) in ASP.NET allowing you to push data from server to client.• Led by David Fowler and Damian Edwards.• Not an official Microsoft project.• OSS project on Github with MIT License.• NuGet packages available.• Simple to setup & just works. Install-Package SignalR
  3. 3. Potential use-cases • Chat - Don’t be that developer * • Real-time impact analysis on current users • Pub-sub mechanism for analytics, logging, exception capture • 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) • “Growl-like” notifications for users* No offense towards someone that has the real need to build a chat application from scratch but this reminds me of the “Learn Rails and build a blog” tutorials years ago.
  4. 4. Samples
  5. 5. SignalR.Server• Two primary approaches to implementing • Persistent Connections (low-level) • Implements an IHttpHandler • Must implement a route to make the endpoint accessible. • public class TestEndpoint : PersistentConnection { // do something } • Hubs (high-level) • Automatically implements route over “<app>/signalr/hubs/” by convention. • public class TestHub : Hub { // do something }
  6. 6. SignalR client libraries• SignalR.Js - Javascript SignalR client• SignalR.Client - .NET client for SignalR• SignalR.Client.WP7 - Windows Phone client for SignalR
  7. 7. Wait, I thought WebSockets were meant for this?This all works over HTTP?
  8. 8. Let’s look at how we interact with the webin a vast majority of scenarios and how some HTTP cleverness allows SignalR to work.
  9. 9. The basic Request-Response pattern
  10. 10. A simple example of polling via AJAX.
  11. 11. is long-polling?
  12. 12. Let’s look at some code.
  13. 13. Resources Bitly bundle * - git repo - docs - * More resources will be added to the bitly bundle in the future
  14. 14. Thank you!Please review the presentation with any feedback or criticisms at