You are previewing SignalR Programming in Microsoft ASP.NET.
O'Reilly logo
SignalR Programming in Microsoft ASP.NET

Book Description

Developers with experience working on the .NET platform and familiarity with HTML and JavaScript will gain the skills to add real-time and async communication features for web, desktop, and mobile phone applications.

Table of Contents

  1. SignalR Programming in Microsoft® ASP.NET
  2. Dedication
  3. Introduction
    1. Who should read this book
      1. Assumptions
    2. Who should not read this book
    3. Organization of this book
      1. Finding your best starting point in this book
    4. Conventions and features in this book
    5. System requirements
    6. Code samples
      1. Notes on the version
      2. Installing the code samples
      3. Using the code samples
    7. Acknowledgments
    8. Errata & book support
    9. We want to hear from you
    10. Stay in touch
  4. 1. Internet, asynchrony, multiuser…wow!
  5. 2. HTTP: You are the client, and you are the boss
    1. HTTP operations
    2. Polling: The answer?
    3. Push: The server takes the initiative
      1. WebSockets
      2. Server-Sent Events (API Event Source)
      3. Push today
        1. Long polling
        2. Forever frame
      4. The world needs more than just push
  6. 3. Introducing SignalR
    1. What does SignalR offer?
    2. Two levels of abstraction
    3. Supported platforms
    4. OWIN and Katana: The new kids on the block
    5. Installing SignalR
  7. 4. Persistent connections
    1. Implementation on the server side
      1. Mapping and configuring persistent connections
      2. Events of a persistent connection
      3. Sending messages to clients
      4. Asynchronous event processing
      5. Connection groups
      6. The OWIN startup class
    2. Implementation on the client side
      1. Initiating the connection by using the JavaScript client
      2. Support for older browsers
      3. Support for cross-domain connections
      4. Sending messages
      5. Receiving messages
      6. Sending additional information to the server
      7. Other events available at the client
    3. Transport negotiation
    4. Adjusting SignalR configuration parameters
    5. Complete example: Tracking visitors
      1. Project creation and setup
      2. Implementation on the client side
        1. HTML markup (tracking.html)
        2. Scripts (Scripts/Tracking.js)
      3. Implementation on the server side
        1. Persistent connection (TrackerConnection.cs)
        2. Startup code (Startup.cs)
  8. 5. Hubs
    1. Server implementation
      1. Hub registration and configuration
      2. Creating hubs
      3. Receiving messages
      4. Sending messages to clients
      5. Sending messages to specific users
      6. State maintenance
      7. Accessing information about the request context
      8. Notification of connections and disconnections
      9. Managing groups
      10. Maintaining state at the server
    2. Client implementation
      1. JavaScript clients
      2. Generating the proxy
      3. Manual generation of JavaScript proxies
      4. Establishing the connection
      5. Sending messages to the server
      6. Sending additional information
      7. Receiving messages sent from the server
      8. Logging
      9. State maintenance
      10. Implementing the client without a proxy
        1. Establishing the connection
        2. Invoking server methods
        3. State maintenance
        4. Receiving messages sent from the server
    3. Complete example: Shared drawing board
      1. Project creation and setup
      2. Implementation on the client side
        1. HTML markup (drawingboard.html)
        2. Scripts (Scripts/DrawingBoard.js)
      3. Implementation on the server side
        1. Hub (DrawingBoard.cs)
        2. Startup code (Startup.cs)
  9. 6. Persistent connections and hubs from other threads
    1. Access from other threads
      1. External access using persistent connections
      2. Complete example: Monitoring connections at the server
      3. Project creation and setup
      4. Implementing the website
        1. Page markup (default.aspx)
        2. Code-behind (default.aspx.cs)
      5. System for tracing requests (server side)
        1. Persistent connection (ConnectionSpy.cs)
        2. Startup code (Startup.cs)
        3. Application global class (Global.asax.cs)
        4. Optional changes in configuration (web.config)
      6. System for tracing requests (client side)
        1. Spying page (spy.html)
    2. External access using hubs
      1. Complete example: Progress bar
      2. Project creation and setup
      3. Implementation on the client side
        1. HTML markup (progress.html)
        2. Styles (Styles/ProgressBar.css)
        3. Script (Scripts/ProgressBar.js)
      4. Implementation on the server side
        1. Hub
        2. Expensive process (HardProcess.Aspx)
        3. Startup code (startup.cs)
  10. 7. Real-time multiplatform applications
    1. Multiplatform SignalR servers
      1. SignalR hosting in non-web applications
        1. Hosting in a console application
        2. SignalR in a Windows service
      2. SignalR hosting in platforms other than Windows
    2. Multiplatform SignalR clients
      1. Accessing services from .NET non-web clients
        1. Creating and opening a persistent connection
        2. Sending and receiving data using persistent connections
        3. Creating and opening connections to hubs
        4. Communication with the server using hubs
        5. Logging
        6. Example: Console application
        7. Example: Windows 8/Windows 8.1 application with C#/XAML
        8. Project creation and setup
        9. MainPage.xaml
        10. MainPage.xaml.cs
        11. Windows Phone 8 clients
      2. Consumption of services from other platforms
  11. 8. Deploying and scaling SignalR
    1. Growing pains
    2. Scalability in SignalR
    3. Scaling on backplanes
      1. Windows Azure Service Bus
        1. Configuring the service
        2. Activating the backplane
      2. SQL Server
        1. Configuring the database
        2. Activating the backplane
      3. Redis
        1. Installing Redis
        2. Activating the backplane
    4. Custom backplanes
    5. Improving performance in SignalR services
      1. Server configuration
      2. Monitoring performance
        1. Connection activity
        2. Errors
        3. Activity in the messaging bus
        4. Scale-out providers
        5. Other useful performance counters
  12. 9. Advanced topics
    1. Authorization in SignalR
      1. Access control in persistent connections
      2. Access control in hubs
      3. Client authentication
    2. An extensible framework
    3. Dependency Injection
      1. Manual dependency injection
      2. Releasing dependencies
      3. Inversion of Control containers
        1. SignalR with Unity
        2. SignalR with Ninject
    4. Unit testing with SignalR
      1. Unit testing of hubs
      2. Unit testing persistent connections
    5. Intercepting messages in hubs
    6. Integration with other frameworks
      1. Web API
      2. ASP.NET MVC
      3. Knockout
      4. AngularJS
  13. A. About the author
  14. Index
  15. About the Author
  16. Copyright