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.
1. Adam Mokan
@adammokan
Desert Code Camp
Nov 5th, 2011
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. 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.
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. SignalR client
libraries
• SignalR.Js - Javascript SignalR client
• SignalR.Client - .NET client for
SignalR
• SignalR.Client.WP7 - Windows Phone
client for SignalR
7. Wait, I thought WebSockets
were meant for this?
This all works over HTTP?
8. Let’s look at how we interact with the web
in a vast majority of scenarios and how some
HTTP cleverness allows SignalR to work.
15. Resources
Bitly bundle * - bit.ly/signalr-dcc11
SignalR git repo - github.com/SignalR/SignalR
SignalR docs - github.com/SignalR/SignalR/wiki
* More resources will be added
to the bitly bundle in the future
16. Thank you!
Please review the presentation with any feedback
or criticisms at speakerrate.com/talks/8878