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

Adding a connection to a group

Multiple clients can connect to a specific Hub at the same time, and the number of connections can easily increase. SignalR offers a feature called groups in order to define subsets of connections and use them when broadcasting to clients. We will see how a Hub can place connected clients into groups and then broadcast calls to all the connections belonging to a specific group.

Getting ready

Before writing the actual code, we need to create a new empty web application, which we'll call Recipe08.

How to do it…

We're ready to start building our sample. We need to perform the following steps:

  1. Add a Hub called EchoHub.
  2. Add an OWIN Startup class named Startup with a Configuration() method calling app.MapSignalR();.
  3. Add the following ...

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