So far, we examined different ways to push information from a server Hub to the connected clients; in particular, we saw how to perform a client-side call just on the caller in the Calling back the caller from a Hub's method recipe. All these techniques have one thing in common: the remote call is performed through the
Clients member exposed by
Hub. However, in the special case of communicating just with the caller, we can use a different, and in some way more natural, way to do it: have the Hub method return a value.
We're ready to start adding our SignalR stuff, as usual. We need to perform the next set of steps:
Add a Hub called
Add an OWIN Startup class named
Startup, containing just a simple
app.MapSignalR();bootstrap call inside the
The following code needs to be added to the Hub:
using System; using Microsoft...