O'Reilly logo

SignalR Real-time Application Cookbook by Roberto Vespa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Calling back the caller from a Hub's method

With this recipe, we are actually starting to look at more interesting and real-time SignalR features. We will see how a Hub can call back into a client that just performed a remote method call.

Getting ready

Before starting with this recipe, we need to create a new empty web application, which we'll call Recipe06.

How to do it…

Let's start building the server-side portion of this recipe using the following steps:

  1. We must first add a Hub called EchoHub.
  2. We must then add an OWIN Startup class named Startup, containing just a simple app.MapSignalR(); bootstrap call inside the Configuration() method.
  3. Let's make the Hub's content look like the following:
    using System; using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Hubs; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required