Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying SignalR Real-time Application Cookbook
  • Table Of Contents Toc
SignalR Real-time Application Cookbook

SignalR Real-time Application Cookbook

By : Roberto Vespa
4.6 (9)
close
close
SignalR Real-time Application Cookbook

SignalR Real-time Application Cookbook

4.6 (9)
By: Roberto Vespa

Overview of this book

Table of Contents (18 chapters)
close
close
SignalR Real-time Application Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
3
Index

Calling a server-side Hub method


After learning how to perform a connection and customize the transport strategy, let's move to the natural next step: calling a server-side Hub method. As we have done so far in this chapter, we'll use the SignalR dynamic proxy generation feature that allows us to perform client-to-server calls in a more natural way. The alternate available approach will be illustrated in the future recipes.

This recipe and the remaining ones of this chapter have a clear goal of illustrating the client-side code in a very detailed way, and that's because we have several important features to explain. For this reason, we'll show the code and comment on it step by step, instead of going directly to its final version and commenting on it afterwards.

How to do it…

Let's proceed to the code, starting with the server side. Perform the following steps:

  1. We first need to add a Hub, which we call EchoHub, and add the following code to it:

     using Microsoft.AspNet.SignalR;
     using Microsoft...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
SignalR Real-time Application Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon