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

Using the return value of a Hub method

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.

Getting ready

For this recipe, we need a new empty web application, which we'll call Recipe13.

How to do it…

We're ready to start adding our SignalR stuff, as usual. We need to perform the next ...

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