Skip to content

Commit cb76428

Browse files
committed
Freshness review of signalr-concept-internals.md
1 parent 25d96db commit cb76428

File tree

1 file changed

+44
-29
lines changed

1 file changed

+44
-29
lines changed

articles/azure-signalr/signalr-concept-internals.md

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,58 @@ ms.service: signalr
66
ms.topic: conceptual
77
ms.devlang: csharp
88
ms.custom: devx-track-csharp
9-
ms.date: 11/13/2019
9+
ms.date: 01/05/2023
1010
ms.author: lianwei
1111
---
1212
# Azure SignalR Service internals
1313

1414
Azure SignalR Service is built on top of ASP.NET Core SignalR framework. It also supports ASP.NET SignalR by reimplementing ASP.NET SignalR's data protocol on top of the ASP.NET Core framework.
1515

16-
You can easily migrate a local ASP.NET Core SignalR application or ASP.NET SignalR application to work with SignalR Service, with a few lines of code change.
16+
You can easily migrate a local ASP.NET Core SignalR or an ASP.NET SignalR application to work with SignalR Service, with a few lines of code change.
1717

18-
The diagram below describes the typical architecture when you use the SignalR Service with your application server.
18+
The diagram describes the typical architecture when you use the SignalR Service with your application server.
1919

2020
The differences from self-hosted ASP.NET Core SignalR application are discussed as well.
2121

2222
![Architecture](./media/signalr-concept-internals/arch.png)
2323

24-
## Server connections
24+
## Application server connections
25+
A self-hosted ASP.NET Core SignalR application server listens to and connects clients directly.
2526

26-
Self-hosted ASP.NET Core SignalR application server listens to and connects clients directly.
27-
28-
With SignalR Service, the application server is no longer accepting persistent client connections, instead:
27+
With SignalR Service, the application server no longer accepts persistent client connections, instead:
2928

3029
1. A `negotiate` endpoint is exposed by Azure SignalR Service SDK for each hub.
31-
1. This endpoint will respond to client's negotiation requests and redirect clients to SignalR Service.
32-
1. Eventually, clients will be connected to SignalR Service.
30+
1. The endpoint will respond to client's negotiation requests and redirect clients to SignalR Service.
31+
1. The clients connect to SignalR Service.
3332

3433
For more information, see [Client connections](#client-connections).
3534

36-
Once the application server is started,
37-
- For ASP.NET Core SignalR, Azure SignalR Service SDK opens 5 WebSocket connections per hub to SignalR Service.
38-
- For ASP.NET SignalR, Azure SignalR Service SDK opens 5 WebSocket connections per hub to SignalR Service, and one per application WebSocket connection.
35+
Once the application server is started:
36+
37+
- For ASP.NET Core SignalR: Azure SignalR Service SDK opens five WebSocket connections per hub to SignalR Service.
38+
- For ASP.NET SignalR: Azure SignalR Service SDK opens five WebSocket connections per hub to SignalR Service, and one per application WebSocket connection.
39+
40+
41+
The initial number of connections defaults to 5 and is configurable using the `InitialHubServerConnectionCount` option in the SignalR Service SDK. For more information, see [configuration](https://github.com/Azure/azure-signalr/blob/dev/docs/run-asp-net-core.md#maxhubserverconnectioncount).
42+
43+
While the application server is connected to the SignalR service, the Azure SignalR service may send load-balancing messages to the server. Then, the SDK starts new server connections to the service for better performance.
3944

40-
5 WebSocket connections is the default value that can be changed in [configuration](https://github.com/Azure/azure-signalr/blob/dev/docs/run-asp-net-core.md#connectioncount). Please note that this configures the initial server connection count the SDK starts. While the app server is connected to the SignalR service, the Azure SignalR service might send load-balancing messages to the server and the SDK will start new server connections to the service for better performance.
45+
<!-- Question: What does this mean? Are the connections client <-> service? -->
46+
Messages to and from clients are multiplexed into these connections.
4147

42-
Messages to and from clients will be multiplexed into these connections.
4348

44-
These connections will remain connected to the SignalR Service all the time. If a server connection is disconnected for network issue,
45-
- all clients that are served by this server connection disconnect (for more information about it, see [Data transmit between client and server](#data-transmit-between-client-and-server));
46-
- the server connection starts reconnecting automatically.
49+
Server connections are persistently connected to the SignalR Service. If a server connection is disconnected due to a network issue:
50+
51+
- All clients served by this server connection disconnect (for more information, see [Data transmission between client and server](#data-transmission-between-client-and-server)).
52+
- The server automatically reconnects the clients.
4753

4854
## Client connections
4955

50-
When you use the SignalR Service, clients connect to SignalR Service instead of application server.
51-
There are two steps to establish persistent connections between the client and the SignalR Service.
56+
When you use the SignalR Service, clients connect to the service instead of the application server.
57+
There are three steps to establish persistent connections between the client and the SignalR Service.
5258

53-
1. Client sends a negotiate request to the application server. With Azure SignalR Service SDK, application server returns a redirect response with SignalR Service's URL and access token.
59+
1. A client sends a negotiate request to the application server.
60+
1. The application server uses Azure SignalR Service SDK to return a redirect response containing the SignalR Service URL and access token.
5461

5562
- For ASP.NET Core SignalR, a typical redirect response looks like:
5663
```
@@ -68,21 +75,29 @@ There are two steps to establish persistent connections between the client and t
6875
}
6976
```
7077
71-
1. After receiving the redirect response, client uses the new URL and access token to start the normal process to connect to SignalR Service.
78+
1. After the client receives the redirect response, it uses the URL and access token to connect to SignalR Service.
79+
80+
To learn more about ASP.NET Core SignalR's, see [Transport Protocols](https://github.com/aspnet/SignalR/blob/release/2.2/specs/TransportProtocols.md).
7281
73-
Learn more about ASP.NET Core SignalR's [transport protocols](https://github.com/aspnet/SignalR/blob/release/2.2/specs/TransportProtocols.md).
82+
## Data transmission between client and server
7483
75-
## Data transmit between client and server
84+
When a client is connected to the SignalR Service, the service runtime will find a server connection to serve this client.
7685
77-
When a client is connected to the SignalR Service, service runtime will find a server connection to serve this client
78-
- This step happens only once, and is a one-to-one mapping between the client and server connections.
86+
- This step happens only once, and is a one-to-one mapping between the client and server connection.
7987
- The mapping is maintained in SignalR Service until the client or server disconnects.
8088
8189
At this point, the application server receives an event with information from the new client. A logical connection to the client is created in the application server. The data channel is established from client to application server, via SignalR Service.
8290
83-
SignalR Service transmits data from the client to the pairing application server. And data from the application server will be sent to the mapped clients.
91+
SignalR Service transmits data from the client to the pairing application server. Data from the application server will be sent to the mapped clients.
92+
93+
SignalR Service doesn't save or store customer data, all customer data received is transmitted to target server or clients in real-time.
94+
95+
The Azure SignalR Service acts as a logical transport layer between application server and clients. All persistent connections are offloaded to SignalR Service. As a result, the application server only needs to handle the business logic in the hub class, without worrying about client connections.
96+
97+
## Next steps
8498
85-
SignalR Service does not save or store customer data, all customer data received is transmitted to target server or clients in real-time.
99+
To learn more about Azure SignalR SDKs, see:
86100
87-
As you can see, the Azure SignalR Service is essentially a logical transport layer between application server and clients. All persistent connections are offloaded to SignalR Service.
88-
Application server only needs to handle the business logic in hub class, without worrying about client connections.
101+
- [ASP.NET Core SignalR](https://docs.microsoft.com/aspnet/core/signalr/introduction)
102+
- [ASP.NET SignalR](https://docs.microsoft.com/aspnet/signalr/overview/getting-started/introduction-to-signalr)
103+
- [ASP.NET code samples](https://github.com/aspnet/AzureSignalR-samples)

0 commit comments

Comments
 (0)