SignalR on .NET 6 - the Complete Guide
$7.99
Minimum price
$9.99
Suggested price

SignalR on .NET 6 - the Complete Guide

The easiest way to enable real-time two-way HTTP communication on .NET 6

About the Book

Are you a web developer or do you write Internet of things (IoT) software? If so, you would know that many web and IoT development projects these days require the ability to establish a persistent connection between a client and a server without having to keep sending repeated requests from the client. For example, a user of a live chat would want to know in real time that they have received a new message. Or an IoT device may need to be sent a command in real time.

As you may also know, such functionality may be hard to implement. However, if you can build your server-side application on ASP.NET Core, there is a way to make this whole process easy. There is a library called SignalR, which is included in ASP.NET Core.

SignalR doesn't only enable you to achieve real-time two-way communication between applications. It also substantially simplifies the process of enabling all of this in the code. Under the hood, it uses various two-way communication protocols, such as WebSocket. However, it abstracts away all the implementation complexity of these protocols. To the developer, working with this library will mostly consists of writing simple and easily readable statements.

In this book, we will cover everything you would need to know about using SignalR on .NET 6, so you will see how to integrate it with the the latest features on ASP.NET Core 6 and C# 10. We will cover much more than you can find in the official documentation of the library. For example, you will learn how to connect a plain WebSocket client to it, which may help you to write a client in a language that isn't officially supported. Likewise, we will cover many concepts that aren't directly related to SignalR, but are important to its production-ready implementation. These would include single sign-on, certificate authorization, logging, metrics and scaling out. By the end of this book, you would be able to identify the situations where SignalR is the best tool for the job and you would be fully able to implement it.

  • Share this book

  • Categories

    • C#
    • ASP.NET
    • .NET
    • APIs
    • Cloud Computing
    • Web Development
    • Internet of Things
    • Computers and Programming
  • Feedback

    You must own a copy of this Book to access the forums.

    Email the Author(s)

About the Author

Fiodar Sazanavets
Fiodar Sazanavets

Fiodar Sazanavets is an experienced lead software engineer whose main area of expertise is Microsoft stack, which includes ASP.NET (Framework and Core), SQL Server, Azure, and various front-end technologies. Fiodar is familiar with industry-wide best practices, such as SOLID principles, software design patterns, automation testing principles (BDD and TDD) and microservices architecture.

Fiodar has built his software engineering experience while working in a variety of industries, including water engineering, financial, retail, railway and defence. He has played a leading role in various projects and, as well as writing software, he gained substantial experience in architecture and design.

Fiodar is an author of a number of technical books and online courses. He regularly writes about software development on his personal website, https://scientificprogrammer.net. He is also available to book for personal mentoring sessions via https://mentorcruise.com/mentor/fiodarsazanavets.


Bundles that include this book

$19.98
Suggested price
$9.99
Bundle Price

Reader Testimonials

Vache Chek
Vache Chek

I would recommend this book

Very easy to read. Informative with good code samples!

Dikaios Papadogkonas
Dikaios Papadogkonas

All you need to create reactive applications

Another great book by Fiodar. It is well written and contains the appropriate amount of information needed to get the job done.

Table of Contents

  • 1 - Introduction to SignalR
    • What makes SignalR so great
    • Example use cases for SignalR
    • Who is this book for
    • The scope of this book
    • Prerequisites
    • How to use this book
    • Book structure
    • About the author
    • Getting touch with the author
  • 2 - Setting up your project
    • Prerequisites
    • Setting up your environment
    • Setting up SignalR hub
    • Making SignalR hub strongly-typed
    • Summary
    • Test yourself
    • Further reading
  • 3 - In-browser SignalR clients
    • Prerequisites
    • Setting up JavaScript client
    • Setting up Blazor WebAssembly client
    • Summary
    • Test yourself
    • Further reading
  • 4 - External SignalR clients
    • Prerequisites
    • Setting up .NET client
    • Setting up Java client
    • Setting up a raw WebSocket client
    • Summary
    • Test yourself
    • Further reading
  • 5 - Sending messages to individual clients or groups of clients
    • Prerequisites
    • Broadcasting messages to all clients
    • Sending messages to specific clients
    • Working with client groups
    • Summary
    • Test yourself
    • Further reading
  • 6 - Streaming in SignalR
    • Prerequisites
    • What is streaming used for
    • Client streaming in SignalR
    • Server streaming in SignalR
    • Summary
    • Test yourself
    • Further reading
  • 7 - Advanced SignalR configuration
    • Prerequisites
    • Configuring SignalR server
    • Configuring SignalR client
    • Pros and cons of MessagePack protocol
    • Summary
    • Test yourself
    • Further reading
  • 8 - Securing your SignalR applications
    • Prerequisites
    • What is CORS and why it’s important
    • Setting up single sign-on provider
    • Applying authentication in SignalR
    • Applying authorization in SignalR
    • Summary
    • Test yourself
    • Further reading
  • 9 - Scaling out SignalR application
    • Prerequisites
    • Setting up Redis backplane
    • Running multiple hub instances via Redis backplane
    • Using HubContext to send messages from outside SignalR hub
    • Summary
    • Test yourself
    • Further reading
  • 10 - Introducing Azure SignalR Service
    • Prerequisites
    • Setting up Azure SignalR Service
    • Adding Azure SignalR Service dependencies to your application
    • Overview of Azure SignalR Service REST API
    • Summary
    • Test yourself
    • Further reading
    • Wrapping up
  • Answers to self-assessment questions
    • Chapter 2
    • Chapter 3
    • Chapter 4
    • Chapter 5
    • Chapter 6
    • Chapter 7
    • Chapter 8
    • Chapter 9
    • Chapter 10

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$11,845,077writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub