Pro ASP.NET SignalR: Real-Time Communication in .NET with SignalR 2.1

Book description

ASP.NET SignalR is the new solution to real-time communication between servers and clients in .NET. Use it to push new data to a web page or mobile device as soon as it becomes available, whether it’s a notification, live chat, up-to-the-minute financial data, or a range of other exciting applications. Innovations like Google live search and live Facebook and Twitter updates are pushing users’ expectations of the real-time web. With Pro ASP.NET SignalR, you can join this revolution and learn skills that will be valuable for years to come.

Pro ASP.NET SignalR starts with an introduction to the real-time web. Learn about the technologies underlying the SignalR library, such as WebSockets and long-polling, and how SignalR elegantly flips between them depending on the capabilities of the client. Next, meet the concepts of hubs and persistent connections and how to use them to build the components of an ASP.NET SignalR application. Find out how to extend, test, debug, configure, scale, and host your applications, and how to target a range of clients, including Windows and iOS.

The book rounds off with two case studies—a stock market price updater, and a collaborative drawing application—so you can get to grips with SignalR in a realistic scenario, using a broad range of the concepts covered in earlier chapters.

As real-time updates to web and mobile apps become the norm, Pro ASP.NET SignalR will be your in-depth, one-stop companion to this new and exciting technology.

Table of contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Authors
  8. About the Technical Reviewer
  9. Acknowledgments
  10. Introduction
  11. Chapter 1: Introduction to the Real-Time Web and ASP.NET SignalR
    1. Evolution of the Internet
    2. Why the Client-Side Experience Is More Important than Ever
    3. Real–Time Web Application Development
    4. Examples of Real–Time Web Application Development
      1. Facebook
      2. Twitter
      3. Google Search
      4. Google Docs
      5. JabbR
      6. ShootR
    5. History of ASP.NET SignalR
    6. What Is ASP.NET SignalR?
    7. ASP.NET SignalR Architecture
    8. Main Challenges for Real–Time Web Development
    9. Transport Options
      1. Long Polling
      2. Forever Frame
      3. Server-Sent Event
      4. WebSockets
      5. How ASP.NET SignalR Uses Transports
    10. Summary
  12. Chapter 2: Overview of SignalR
    1. Technologies Behind SignalR
      1. Open Web Interface for .NET (OWIN)
      2. Connection Transports
      3. Dependency Resolver
      4. Task Parallel Library
      5. Message Backplanes
    2. Supported Server Platforms and Clients
      1. Server Platforms
      2. Client Platforms
    3. Getting Started with SignalR
      1. NuGet
      2. First Sample Application
    4. When to Use SignalR
      1. Understanding the User Experience
      2. General Categories of SignalR Applications
      3. When Not to Use SignalR
    5. Extensibility of SignalR
      1. OWIN Components
      2. IoC Containers
      3. Scaling Out with Message Backplanes
    6. Limitations of SignalR
      1. Server Platform Limitations
      2. Client Platform Limitations
      3. Message Backplane Limitations
      4. External Limitations
    7. Summary
  13. Chapter 3: Developing SignalR Applications Using Hubs
    1. Overview of Hubs
    2. Getting Started with Hubs
    3. Route Configuration
      1. Customize the Hubs Proxy Location
      2. Cross-Domain Connections
    4. Multiple Hub Declaration
    5. Custom Hub Names
    6. Custom Types
    7. Groups
    8. Accessing Particular Clients
    9. Connection Lifetime Management
    10. Context
    11. State Management
    12. Tracing
    13. HubDispatcher
    14. HubPipelineModule
    15. Summary
  14. Chapter 4: Developing SignalR Applications Using Persistent Connections
    1. What Is a Persistent Connection?
      1. Properties of a Persistent Connection
      2. How Persistent Connection Works
      3. Using a Persistent Connection Instead of a Hub
    2. How to Configure Persistent Connections
      1. Persistent Connection Route Configuration
      2. Global Timeout and Keep-Alive Configurations
      3. HostContext Configuration
    3. Server Communication to Clients Over Persistent Connections
      1. Negotiation
      2. Ping
      3. Connect
      4. Send
      5. Poll
      6. Abort
    4. Signaling Between Server and Clients
      1. Server-side Events
      2. Client-side Events
    5. Communication and Signaling Example Using a JavaScript Client
      1. Server Code for Client Example
      2. JavaScript Client Example
    6. Connection Grouping
      1. GroupManager
      2. Group Membership
      3. Group Persistence
    7. Summary
  15. Chapter 5: Troubleshooting ASP.NET SignalR Applications
    1. ASP.NET SignalR Troubleshooting Overview
    2. Using Chrome Developer Tools for Client-Side Debugging
    3. Using Fiddler for Client-to-Server Communication Debugging
    4. Debugging the Server-Side Execution
    5. Tracing Features
    6. Summary
  16. Chapter 6: An Overview of the Clients that Support SignalR
    1. Clients Supported by SignalR
      1. Client Configuration
      2. Client and Server Communication
      3. connection.TraceWriter = Console.Out;Connection Lifetime Events
      4. Server Example for Clients
    2. HTML and JavaScript Clients
      1. Persistent Connection Client
      2. Hub Client
    3. .NET Clients
      1. Persistent Connection Client
      2. Hub Client
    4. Silverlight Clients
      1. Persistent Connection Client
      2. Hub Client
    5. Windows Store Clients
      1. Persistent Connection Client
      2. Hub Client
    6. Windows Phone 8 Clients
      1. Persistent Connection Client
      2. Hub Client
    7. Summary
  17. Chapter 7: How to Extend and Customize SignalR Functionality
    1. Extensibility of the SignalR Core
      1. Implementing a Custom Dependency Resolver
      2. Extending Existing Components
      3. Replacing Individual SignalR Components
    2. Self-Hosting SignalR Outside of IIS
      1. Self-Host Example
      2. Adding Windows Authentication and IIS Pipeline Stages to Applications
    3. Linux and OS X Support Using the Mono Framework
      1. What Is the Mono Framework?
      2. Setting Up the Development Environment
      3. Setting Up the Hosting Environment
      4. Creating a Mono SignalR Server
      5. Mono Framework on OS X
    4. Using the Xamarin Add-in for Visual Studio to Create iOS and Android SignalR Clients
      1. Setting Up the Xamarin Add-in for Visual Studio
      2. Creating Android Applications
  18. Chapter 8: Configuration, Deployment, and Security Aspects of SignalR
    1. Authentication and Authorization in ASP.NET SignalR
      1. Authentication and Authorization for Hubs
      2. Authentication and Authorization for Persistent Connections
    2. Configuration Aspects of ASP.NET SignalR Applications
    3. Recommended IIS Settings for ASP.NET SignalR Applications
      1. Default Message Buffer Size
      2. Maximum Concurrent Requests per Application
      3. Maximum Concurrent Requests per CPU
      4. Request Queue Limit
    4. Deploying ASP.NET SignalR Applications
    5. Performance Counters
    6. OWIN and ASP.NET SignalR
    7. Summary
  19. Chapter 9: Case Study 1: Stock Ticker
    1. Project Overview
    2. StockTicker Server Side
      1. Startup
      2. Stock Domain Class
      3. StockTicker Hub
      4. StockTicker Back-end Provider
    3. StockTicker Client Side
      1. HTML
      2. JavaScript
    4. Summary
  20. Chapter 10: Building a Collaborative Drawing Application
    1. Project Overview
    2. Developing the Server
      1. Enabling Real-Time Interactivity Using SignalR
      2. Adding API Endpoints
      3. Securing the Server
      4. Setting Up the Dependency Resolver
      5. Setting Up the OWIN Pipeline
    3. Hosting the Server in Azure
      1. Implementing theRoleEntryPoint Class
      2. Creating theCloud Service
      3. Creating the AzureSQL Database
      4. Configuring the WorkerRole
      5. Testing DeploymentLocally
      6. Deploying an Application to the Cloud
    4. Scaling the Server
    5. Developing the Clients
      1. Developing the Client Homepage
      2. Developing the Client Canvas Room
    6. Summary
  21. Index

Product information

  • Title: Pro ASP.NET SignalR: Real-Time Communication in .NET with SignalR 2.1
  • Author(s): Keyvan Nayyeri, Darren White
  • Release date: December 2014
  • Publisher(s): Apress
  • ISBN: 9781430263203