Pages

Tuesday, February 26, 2013

A First Look at SignalR

Introduction

SignalR
I stumbled upon SignalR just about 2 months ago, while looking for some abstraction over Web-Sockets with a fallback to other transports for older User Agents.

Back then I've already heard, and read a little about Socket.IO, and Node.JS, but wanted a .NET library for my upcoming project.

So when I've landed on the SignalR project page, and read about what SignalR is all about, and how can it be used, I was VERY exited.

So, if you are into "Real-Time Web", and looking for an ASP.NET, IIS hosted solution, then SignalR is the answer for all your prayers, and more (as I'm learning each day I'm diving deeper into it...).

Getting Started with SignalR

In order to put your hands on SignalR and start coding against the API, you'll first need to set up the environment and get the project's libraries.

IIS 8.0


Although not required for development and testing, pay attention that Web-Sockets are only supported on IIS starting with IIS 8.0. This means that in order to gain the full benefits that SignalR provides you should deploy your solution to Server 2012 (which is of course available for both PaaS and IaaS on Azure).

For development and testing you can use IIS 8.0 Express, which is bundled with Visual Studio 2012.

I've used this opportunity, along with the concept of starting a new year, to install Windows 8 and Visual Studio 2012. Windows 7 was great, but Windows 8 is even greater...

Visual Studio 2012


You'll need Visual Studio 2012. Or at least the Visual Studio 2012 Express Version, which is free to download from the Asp.Net website.

SignalR Lib


2 months ago, I've downloaded version RC1, and it was available as a zip package from the project's site. This option is still viable, although it is also available as a Nuget package, or better yet as part of the 2012.2 update.

Earlier this month, on February 18, Scott Guthrie announced the final release of ASP.NET and Web Tools 2012.2 Update. This update, among other exiting new stuff, contains all the necessary components for SignalR development.

A Getting Started Tutorial


You can find a great step-by-step introductory tutorial on the Asp.Net website, here, along with some great videos demonstrating this new framework. Don't skip those videos.

So far I've done a simple POC, deployed it to a Web-Role on Windows Azure, and it works like charm.


In my upcoming posts I'll start investigate SignalR, and get a look deeper into the Transports, Scale-Out on Windows Azure, Security issues, and basically look behind the Magic...

No comments:

Post a Comment